RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic Goto page 1, 2  Next 
View previous topic - View next topic  
Author Message
Jihgfed Pumpkinhead
Stephen Hawking


Joined: 21 Jan 2003
Posts: 259
Location: Toronto, Canada

PostPosted: Sat May 17, 2003 9:59 pm    Post subject: Non-tile-based Map [quote]

[Oops, this should have been in the new technical forum. Sorry.]

Call me unimaginative or inexperienced if you like, but I've never really thought about doing an RPG without a tile-based map.

But I was working on my map editor, and kept bumping into memory constraints. Sure, I haven't optimized at all, but I also haven't included nearly all the objects I want to have in my map. Currently, I take the image I want, and split it up into a bunch of tiles, load those tiles in, etc. So instead, I was thinking I could just draw the image straight to the screen. This will make it easier (I think) to start loading images on the fly, if I need to; also, the amount of compression you can do on a large image puts to shame the amount you can do on a tile.

So, since I imagine the graphical style of the game will mostly be large objects on single colour background (example), I was thinking the map file could just consist of a list of object ids and locations, rather than a complete list identifying every location on the map.

Then, to draw the map to the screen, you just search it for all the objects which are in, or extend into, whatever the screen area is. You'd have to cap object size at some arbitrary number to keep the search from getting out of hand.

The search seems to lend itself to some "two-dimensional tree" sort of search, a concept so deeply insane I can't even begin to envision it. I suppose I could keep two trees, one for x and one for y co-ordinates, and look for inter-sections, but that seems sort of kludgey.

So that's what I'm thinking. I imagine collision detection becomes a real pain for non-square objects, but I guess I could compose such objects out of smaller square ones. This is also really only worthwhile (I think) for maps with a very prevalent default terrain.

Anyway, I'm sure stuff like this has been done (unless it's a really bad idea, which is possible), I just don't know where to look for information on it. I just came up with it, so I'm not too attached to it, and so please feel free, encourage even, to bash it about however you like. Better you point out the problems to me now than I figure them out after having been working on it for weeks.

Thanks a lot.
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Sat May 17, 2003 10:27 pm    Post subject: [quote]

This should help:
http://www.qbasicnews.com/articles.php?id=6
Back to top  
ThousandKnives
Guest





PostPosted: Sat May 17, 2003 10:46 pm    Post subject: [quote]

I've contemplated a similiar idea. I was once considering using a combination of tile and non-tile data actually. Tile data for the "field" (grass, dirt, paths, water, etc) and the "overlay" data (trees, rocks, cliffs, etc) would simply be a position-independent linked-list of objects.

Which is pretty much what I already do for (what I call) "map objects" (interactive/moving things), this would simply extend that method to "dumb" map objects.

The only performance issue I can see is when you have a large-sized map with a lot of objects present on it, you will have to sort through a rather long list of objects to determine which ones are on-screen and which ones arent. You may even need to fumble through the list multiple times if you are going to "layer" the objects (There may be a way around that though).

I mean, you arent likely to have hundreds of villagers on a map, but you are much more likely to have hundreds (or even thousands) of trees/bushes/plants/rocks.

Just my thoughts on it. I think it could definately work though.
Back to top  
Mobius
Monkey-Butler


Joined: 23 Jul 2002
Posts: 56
Location: denile

PostPosted: Sun May 18, 2003 4:12 am    Post subject: [quote]

what would be good also is to go even farther and add Red Alert/Starcraft style map editing so you can have both single tiles and "blocks" to create maps
_________________
It is best not to meddel in the affairs of dragons for you are crunchy and taste good with a varity of condoments.
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Sun May 18, 2003 5:39 am    Post subject: Re: Non-tile-based Map [quote]

Jihgfed Pumpkinhead wrote:
[Oops, this should have been in the new technical forum. Sorry.]

Call me unimaginative or inexperienced if you like, but I've never really thought about doing an RPG without a tile-based map.

But I was working on my map editor, and kept bumping into memory constraints. Sure, I haven't optimized at all, but I also haven't included nearly all the objects I want to have in my map. Currently, I take the image I want, and split it up into a bunch of tiles, load those tiles in, etc. So instead, I was thinking I could just draw the image straight to the screen. This will make it easier (I think) to start loading images on the fly, if I need to; also, the amount of compression you can do on a large image puts to shame the amount you can do on a tile.

So, since I imagine the graphical style of the game will mostly be large objects on single colour background (example), I was thinking the map file could just consist of a list of object ids and locations, rather than a complete list identifying every location on the map.

Then, to draw the map to the screen, you just search it for all the objects which are in, or extend into, whatever the screen area is. You'd have to cap object size at some arbitrary number to keep the search from getting out of hand.

The search seems to lend itself to some "two-dimensional tree" sort of search, a concept so deeply insane I can't even begin to envision it. I suppose I could keep two trees, one for x and one for y co-ordinates, and look for inter-sections, but that seems sort of kludgey.

So that's what I'm thinking. I imagine collision detection becomes a real pain for non-square objects, but I guess I could compose such objects out of smaller square ones. This is also really only worthwhile (I think) for maps with a very prevalent default terrain.

Anyway, I'm sure stuff like this has been done (unless it's a really bad idea, which is possible), I just don't know where to look for information on it. I just came up with it, so I'm not too attached to it, and so please feel free, encourage even, to bash it about however you like. Better you point out the problems to me now than I figure them out after having been working on it for weeks.

Thanks a lot.



I've tried the EXACT same concept....after spending about a year on trying to get the damned coordinates, and linked lists working.. I realized that it wasn't worth it, and I scrapped the project.

It HAS been done before (take a look at the FFVII & FFVIII games, where it consists of a base image, a MOL (movable object layer) and a topmost image layer. The way that they kept the characters on the screen, was an invisible collision layer, that was a list of coordinates that made a virtual barrier of certain areas.

* a note to all * this is not 100% proven information from squaresoft.
This is just what I figured out from taking apart FF games for the past few years.
Final Fantasy (C) & (R) & TM SquareSoft or whatever. :p
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Nephilim
Mage


Joined: 20 Jun 2002
Posts: 414

PostPosted: Sun May 18, 2003 1:00 pm    Post subject: [quote]

Well, I think the idea is certainly feasible if you organize it correctly, and it certainly seems like this sort of engine would be better suited to what you are envisioning, which goes a long, long way towards justifying spending time investigating it.

I suspect that you will get a lot of development advantage if you can narrow down your requirements in certain particular ways from being arbitrarily sized and placed images.

For instance, having a maximal size for a graphic would allow you to make a very quick cull of objects outside the visible extents based on an x or y sorting because you could compute the range of elements to consider. For instance, if objects can get no larger than 100x100, then you only have to check items whose registration point is between the left x minus 50 and the right x plus 50. (Of course, depending on the number of tiles you have, it might be faster to just skip directly to the rect intersection test for each tile.)

Another good way to define a dividing line of when to break something up into multiple tiles would be a requirement that the boundary definition for the tile would be a convex region, and then store that convex region to the tile. That way, when you draw your screen, you automatically generate a list of convex regions which define whatever boundaries you need to check against.

Let us know what you discover in your investigations - I'd be interested to hear your experiences.
Back to top  
DrunkenCoder
Demon Hunter


Joined: 29 May 2002
Posts: 559

PostPosted: Sun May 18, 2003 4:32 pm    Post subject: [quote]

did I hear anyone say quadtree?
no?
google it...
_________________
If there's life after death there is no death, if there's no death we never live. | ENTP
Back to top  
BigManJones
Scholar


Joined: 22 Mar 2003
Posts: 196

PostPosted: Sun May 18, 2003 5:01 pm    Post subject: [quote]

Yep, I was going to suggest that using some typically 3d oriented algos squished down to 2d would be worth looking into. Although I don't have experience with quadtrees myself they will allow you to divide your scene up into visible/nonvisible bits. Also, using line intersection test for collision detection would be neat (again, I've never done it.)

If your going to be using pathfinding, have irregular shapes and maps will make using the A* algorithm very difficult.
Back to top  
The Anarchist
Slightly Deformed Faerie Princess


Joined: 13 Feb 2003
Posts: 32
Location: London, England

PostPosted: Sun May 18, 2003 7:19 pm    Post subject: [quote]

DeveloperX: You know, thats pretty much what I thought when I spent a little time thinking about how FF7 worked (I do this to almost all my games, which now I come to think of it is pretty sad). The scrolling on the visible layer only corresponds to how things are moving in the virtual layer, and wether or not you've crashed into a virtual line. Although, having said that FF7 had some parts where instead of straight forward, scrolling up and down, the character would be 'walking into the distance', in which case the method might not work in the same way.
_________________
Some may know me as MidnightDreamer... time for a namechange.
blackgc.f2g.net
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Mon May 19, 2003 4:41 am    Post subject: [quote]

The Anarchist wrote:
DeveloperX: You know, thats pretty much what I thought when I spent a little time thinking about how FF7 worked (I do this to almost all my games, which now I come to think of it is pretty sad). The scrolling on the visible layer only corresponds to how things are moving in the virtual layer, and wether or not you've crashed into a virtual line. Although, having said that FF7 had some parts where instead of straight forward, scrolling up and down, the character would be 'walking into the distance', in which case the method might not work in the same way.


Have you ever played around with the debug room in FFVII on PSX? using the gameshark code? It is NOT easy to decipher every action, but I mapped it out on paper.. had I a scanner, I would scan it all in, and write an article, but alas, another day, another scanner :p
Anyway, I figure out how to access variables, routines, settings, and even view source snippets!

It is possible to 'save' your modifications to a file on the memorycard, but it requires a heavily modified gameshark pro, a parallel cable, some ICs, and an old xt keyboard (yes I build this device myself)
Anyway, I made a patch card for my friend, which allowed:
playing as sephiroth (well, his 3d MODEL, not storywise)
duplicating items by sacrificing hp points.
getting all items, weapons, materia, chocobos, and vehicles, and characters at the start of the game (buggy as hell)
making monsters die with 1 hit.
changing colors of the palette.
and my personal favorite,
putting barret into a dress, ala using cloud in a dress model & barrets model together (placing them in exact location, and hiding certain limbs.)

Anyway, I don't have any of this documented (majorly unfortunate)
And The patchcard has been destroyed by flooding.
I _CAN_ however talk to my friend about if he has a backup, any mods, etc.. we'll see.
Maybe I'll start trying to build a device to code on the ps2?? well.. only time will tell.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
mandrake@rpgdx
Guest





PostPosted: Thu May 22, 2003 6:39 pm    Post subject: [quote]

Quote:

So, since I imagine the graphical style of the game will mostly be large objects on single colour background (example), I was thinking the map file could just consist of a list of object ids and locations, rather than a complete list identifying every location on the map.


heh, I've been doing this for YEARS. DEATH TO TILEMAPS!
Back to top  
twinsen
Stephen Hawking


Joined: 21 May 2003
Posts: 242
Location: Melbourne, Australia

PostPosted: Thu May 22, 2003 11:02 pm    Post subject: [quote]

Well wasn't the whole reason tilemaps were used was because of memory restrictions back in the old days. Nowadays computers and video cards are fast enough and have enough memory to do away with tiles- why should we have to put up with boring repeditive graphics anymore? I agree- death to tilemaps. Oh well, thats my two cents- feel free to abuse me if you feel strongly otherwise :)
_________________
Lovely girls & great prices always available at CLUB 859, 859 Glenhunly Road, Caulfield, Open 10am till late 7 days. +61-3-9523-8555. (Sorry, it was in front of me in the newspaper, I just had to use it as a signature!)
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Fri May 23, 2003 1:44 am    Post subject: [quote]

I feel strongly otherwise, because I can't do graphics as impeccable as Baldur's Gate! :P
Back to top  
twinsen
Stephen Hawking


Joined: 21 May 2003
Posts: 242
Location: Melbourne, Australia

PostPosted: Fri May 23, 2003 1:57 am    Post subject: [quote]

Quote:
I feel strongly otherwise, because I can't do graphics as impeccable as Baldur's Gate!


Neither can I. But even if you can't I still think it still makes things much easier to ditch the old tilemap concept and just create a large image for the whole world.

You don't have to worry about the hassles of doing per-pixel scrolling in a tile system by keeping pixel offsets for the tiles and world offsets. Your image placement is not restricted to a tile grid, you can place a tree graphic in front of a house without having to create specifc tiles for that purpose. You can just load up all your graphic assets into photoshop, drag them around in different layers till it looks right and then flatten the whole lot and save it out to a graphic file for use in the game.

I don't know, call me a lazy little **** but yeah, it just seems a hell of a lot easier and faster. I mean a modern day graphics card can render anywhere between 80-200 million traingles/second on a screen, its not exactly going to tax the CPU/GPU to render the world as a bitmap and scroll around it.

I've made both sorts of engines in the past, and its much easier to code and make changes to non-tile based world. I'm just looking at it from the perspective that it makes level editing easy- you don't need to create a custom tile-based editor, and you don't need to both with the hassle of setting up a tile scroller.

Oh well, thats my $0.02 (less tax)

Twinsen
_________________
Lovely girls & great prices always available at CLUB 859, 859 Glenhunly Road, Caulfield, Open 10am till late 7 days. +61-3-9523-8555. (Sorry, it was in front of me in the newspaper, I just had to use it as a signature!)
Back to top  
DrV
Wandering Minstrel


Joined: 15 Apr 2003
Posts: 148
Location: Midwest US

PostPosted: Fri May 23, 2003 2:03 am    Post subject: [quote]

hehe... $0.02... nothing certain but death and taxes.

But I think tile-based maps are good, for a few reasons:

1. The graphics don't take up a huge amount of space (tilesets can be relatively small)

2. Collision detection and the like are easier to program

3. It's not really that hard to write a p*p scroller... ;)

but like you said, it's kind of a matter of opinion.
_________________
Don't ask no stupid questions and I won't send you away.
If you want to talk fishing, well, I guess that'll be okay.
Back to top  
Post new topic Reply to topic Page 1 of 2 All times are GMT
Goto page 1, 2  Next 



Display posts from previous:   
Jump to:  
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 vote in polls in this forum