Mirage Source

Free ORPG making software.
It is currently Fri Apr 19, 2024 7:43 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ] 
Author Message
 Post subject: My Map Type...
PostPosted: Sat Jun 06, 2009 7:38 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Alright, so I'm trying to get proper maps implimented into my... demo i guess. It's not a game yet.

And i've been trying to do it on my own, without looking at other source.

Here is what i have come up with

Code:
Type Tile
    Ground As Point
    Mask As Point
    Fringe As Point
End Type

Type Map
    MapName As String
    Tile(1 To MAX_MAP_X, 1 To MAX_MAP_Y) As Tile
End Type

Public Map(1 To 5) As Map


I made each layer a point, so you can also have the tile x and y offset for the tilesheet

Example

Map(MapNum).Tile(x, y).Ground.X would be the ground tile at spot X by Y on the map, and .X is the X offset for the Tilesheet

hmm. perhaps my entire rendering sub may be necessary, since im not good at explaining.

Code:
Public Sub DrawMap()
Dim x As Long
Dim y As Long

With CDX8
.SetTexture TextureID.Tiles

For x = 0 To MAX_MAP_X - 1
    For y = 0 To MAX_MAP_Y - 1
       
        .TextureControl (x * 32) + 8, (y * 32) + 8, 32, 32, Map(1).Tile(x + 1, y + 1).Ground.x * 32, Map(1).Tile(x + 1, y + 1).Ground.y * 32, .ARGB(255, 255, 255, 255), False
        .Draw
       
    Next y
Next x
End With
End Sub


Albiet, this only renders the ground layer right now.

Note:
Code:
.TextureControl StartX, StartY, Width, Height, Xoffset, Yoffset, .ARGB, Locked?


What do you guys think? Really crappy? or not so bad?


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sat Jun 06, 2009 9:26 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
No comments?


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 1:55 am 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Well this is a first, you all usually have something to say...


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 1:57 am 
Offline
Banned
User avatar

Joined: Mon Jun 05, 2006 9:22 pm
Posts: 394
Location: USA
Spam to get comments usually doesn't make people want to talk about what you actually say.


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 2:08 am 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Well, considering how long on average it takes anyone around here to reply to even the most ridiculous things. I figured an average of 3 hours between my posts was a bit over the norm.

Either way. I've been wanting to get some real feed back on this before I leave for a week tomorrow, so I know if I'm going to need to reprogram my map system or if this way should be efficient enough to work fine. I won't have internet where I'm going, I don't want to wait till I get back to start programming again, and I don't want to start programming the rest, only to get home and realize that what i have been doing was based off of something that wasn't worth pursuing.

So, does anybody have any intelligent (not insults or somethings else you all might think off :P) feedback on my system.


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 6:44 am 
Offline
Knowledgeable

Joined: Sun Jul 29, 2007 12:23 am
Posts: 199
Here's some feedback. Good work :)


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 12:52 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Doh -_- :P

Thanks :)


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 07, 2009 9:18 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
The last 2 parameters are optional and you might get better FPS if you leave them out when you can. Light = -1 (which is .ARGB(255, 255, 255, 255) and Locked is false by default. So you don't need to use them.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Mon Jun 08, 2009 2:04 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
Also I have a question with As Point...

You make a new type, right?

Code:
Private Type Point
    X As Long
    Y As Long
End Type

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Thu Jun 11, 2009 11:33 pm 
Offline
Regular
User avatar

Joined: Sat Sep 13, 2008 8:25 pm
Posts: 69
Location: Slovenia
Isn't there POINT type in vb6 already?

_________________
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Fri Jun 12, 2009 12:05 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
I don't think so.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Fri Jun 12, 2009 12:46 am 
Offline
Regular
User avatar

Joined: Sat Sep 13, 2008 8:25 pm
Posts: 69
Location: Slovenia
I just checked out, there is POINT type with X and Y variables

_________________
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Fri Jun 12, 2009 2:11 am 
Offline
Knowledgeable

Joined: Sun Jul 29, 2007 12:23 am
Posts: 199
My VB doesn't read Point. How to get it to work?


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Fri Jun 12, 2009 4:04 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
Blodyavenger wrote:
I just checked out, there is POINT type with X and Y variables


What are you talking about? Points are UDTs.

_________________
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 14, 2009 6:45 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Alright Giaken, thanks, I'll check it out.

And at least my VB6 has POINTS already in. but if don't I suppose you could just make your own type, like Giaken posted. It'd be the same thing pretty much.


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Sun Jun 14, 2009 10:14 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
That's weird...I can't find anything on a Point type.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Mon Jun 15, 2009 8:29 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
Maybe he didn't put "Option Explicit" in the very top of the module. If I don't do that and didn't define the variable I'm setting then I don't get any errors.

_________________
Image


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Tue Jun 16, 2009 3:07 pm 
Offline
Regular
User avatar

Joined: Sun Jun 01, 2008 8:39 pm
Posts: 91
You should always have "Option Explicit On". Look here for an explanation and why you should use it.


Top
 Profile  
 
 Post subject: Re: My Map Type...
PostPosted: Tue Jun 16, 2009 3:13 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
Ok, just to satisfy you guys, I went and checked. And I have 'Option Explicit' at the top of all of my forms, modules, and classes.

So those of you who can't get it, 'tis fucked up :D JK, just create a Type Point, with X as long and Y as long. And your good :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group