PDA

View Full Version : Isometric Scrolling Tile Engine


doob
07-03-2007, 12:57 AM
Hi All,
First of all, sorry for all the questions and thanks to those who make it to the end :)

I'm in the planning stages of a scrolling isometric tile engine which will eventually be integrated with smartfox/electroserver to create a multiuser online world. I've read about a few different approaches to iso tile engines, but would appreciate some advice from anyone who has experience with this sort of thing.

Alot of articles suggest creating a movieclip with each tile on a seperate frame, the same tile is duplicated multiple times and then just set to the relevant frame number. Is this a good approach? or would it be better to just attach the required movieclip to an empty tile?

I need to store the tile data externally so I can load in new maps, so the first question is which format? XML seems to be quite a large filesize (for a 1000x1000 grid it's approx 20mb, i know this is a huge map but thinking beyond my requirements). A text file with rows seperated by a *, and columns seperated by, takes alot less space (1.8mb for a 1000x1000 grid). For these tests I stored an integer for each tile to represent the tile type. What would be the best way to handle external data for potentially large maps?

Once the data is loaded I need to display only tiles within a specified view window. I'm thinking if I load the whole map in to a 2d array, i could select, for example, a 10x10 section of the array which is used to draw the tiles. As the character moves around the world, the 10x10 array is updated and the map is redrawn. I've just done a quick test, and a 1000x1000 array of integers in flash uses 75mb RAM, so i don't think that's a good idea. Any suggestions how to handle this? Maybe I seperate the map into areas and load a portion of the map based on the area the character's in?

What is a good overall structure? In 'flash game design demystified' the tile based world has the objects in the tiles themselves, this seems to limit me to objects that fit within the tile. I've seen another example which suggests having the tiles on one layer, the objects on another layer, and the collisions/triggers on a final layer. I like the idea of a multi layer approach, as this appear to be more flexible and would work better with having large objects on the map, such as buildings. This overall design is the bit I'd would really appreciate some experienced advice with, I can figure the rest out myself if i can get a good design together.

Once I've got the tile engine idea sorted, i need to incorporate the multiuser functionality, like how to show other users that should be visible in the viewable window. Should I worry about this after? or is it something that should be built in from the beginning?

Any help with the initial planning of a multiuser scrolling iso engine, or tips and best practices would be greatly appreciated. Thanks for taking the time to read this.

psychopixel
10-09-2007, 04:27 PM
are you still developing the isometric tile engine? I'm starting now the same project in as3, can we collaborate?
hope ou can reply me
rob

rrh
10-09-2007, 06:04 PM
75 Mb for a 1000x1000 array? Could that be right? 1000x1000=1 million so this means each integer is 75 bytes?

Greg SS
11-15-2007, 08:52 PM
Its better (from memory footprint point of view) to have one movieclip for each tile. Its even better if you don't have any movieclip tiles at all, just use bitmap data and blit it directly to the stage movieclip.

To save tile map, use a flat text file, although to get the smallest size possible, you might want to use bitmaps (don't laugh). If you're using AS3 (and know what you're doing), store your external tile map as PNG.
Compared to the other 2 format, PNG is the best bet for storing byte size information. Jpeg uses lossy compression that makes it not suitable for data storage, and GIF can only have 256 colors, which sounds good, until you get a severe headache trying to decode the damn color table.
Another plus is that PNG stores all color value (RGBA), which makes it a perfect and compact data storage.
To access the data stored in the BitmapData, use ByteArray. You can use the getPixels(Rectangle) function to extract pixel information, and map that to a 2D array, or use it as is.

Again, to store data in memory, I suggest BitmapData because its already formatted as a 2D surface. Like I said, you can use getPixels(Rect) and you'll get the data automagically.

Layers is the way to go. BitmapData already have 4 layers built into it (RGBA), each can contain 255 tiles.

Now coding all these in flash is actually the easy part... The hard part is trying to convert all your tile data into bitmap in the first place.

TJones
11-21-2007, 02:53 PM
Hey guys,

To start off with, you have alot of good questions concerning how you want your game setup. These are really best answered according to features you want available, if you are building a level editor tool to go with it, etc...

I've read or own just about every book / website out there pertaining to Isometric worlds, and one thing you need to understand is that there are many ways to accomplish it, but some give drastically different results.

I am in final stages of my company's project which is an Isometric engine and Level Editor. The thing is huge, feature rich and posses features from just about every type of isometric game ever made using 2D assets. Therefore I have solved many of the questions regarding assets that you have asked in your post. Our engine posseses the ability to perform multiple types of collision detection from grid, to zone, point to point, point to radius, bounding box to bounding box, etc. We also have multiple types of world objects, some which occupy multiple tiles (tricky when it comes to drag and drop in a level editor) as well as elevated floors, gravity, etc...

At this time we do not support scrolling but will incorporate it in the new year after migration to AS 3.0, so I can't really comment on that topic, but I can on others.

The problem I have run into with my project is I am the sole programmer. We have multiple artists, but when I get stuck, I have no one to bounce theory or ideas off of.

I am sure when I migrate to 3.0 I will have some questions for you guys as well, so I am more than willing to give you my input and tell you what I found worked for me with some of your questions. It would appear I am much further along in my project than you and I may be able to save you a few headaches.

I can't show you anything that is completed on the project itself until release (slated for January), but I have some odds and ends here and there that may be useful to you.

If you want to contact me directly, go to my company splash page and click to email me (TJ) at www.tangerinepop.com. ;) Hope we can all help each other out.


TJ

crazyoval
11-27-2007, 07:54 PM
hi TJ, Im looking forward to seeing your editor. Im researching and planning a MMOG at present and want to start with a good set of tools. Pls let me know when it is available to view.

Many thanks

TJones
08-05-2008, 03:19 AM
Sorry I let this thread drop. We now have a stable build and you can read about the editor on our site at http://www.tangerinepop.com.

To see the results in action via our GSE game engine, try out our first game built with the editor - GraveShift http://www.tangerinepop.com/graveshift. This game demonstrates true 3D to 2D transformation, physics and movable objects, enemies with multiple types of AI which are all settable via the rollout properties panels...

We still have to finish the In Game map editor (I have a bug that's got me a little torqued), but once done you will be able to access an ingame map of the rooms you have visited.

TH

QuantumTiger
08-05-2008, 09:48 AM
That looks like a really useful editor. Shame it's not publicly available yet.

TJones
08-05-2008, 05:36 PM
That looks like a really useful editor. Shame it's not publicly available yet.

Well, actually it's available, but requires us to do some custom tayloring to a client's specific needs.

TJones
08-06-2008, 01:33 AM
I was asked in another forum about the Editor UI and capabilities, so here is a copy of what was posted.

The example below shows an enemy generator selected and the properies rollout menus. As you can see from what is visible, the customization is highly flexible. The far right properties are for the generator itself. The advanced properties are for what type of behaviors the enemies that spawn from the generator will have.

http://www.tangerinepop.com/production/images/Editor_1.gif

This next image shows the UI used for setting logical objects. In this case there is a plinth with a Key on top. In order to get the plinth to lower and the key become accessable, the generators listed in the cause group must be destroyed. This logic is completely customizable according to the cause / effect groups one wishes to setup.


http://www.tangerinepop.com/production/images/EvtObjProperties.gif

Setting sounds for things like pickups, enemy attacks, collision, etc., can be done from the sound interface. Sounds have been group and tabbed for easy organization (Dynamically)

http://www.tangerinepop.com/production/images/SoundPanel.gif

Hope this sheds a little more light on the editor and it's capabilities.


TJ