Tile Based Games & Coding Questions

Talk about whatever topic you'd like, RPG related or not. (But please discuss things related to our software in the Tools section, below.)

Moderators: dorpond, trevor, Azhrei

Post Reply
Spyre2000
Kobold
Posts: 6
Joined: Tue Sep 18, 2012 1:06 pm

Tile Based Games & Coding Questions

Post by Spyre2000 »

Hi guys I've used RPTools for a while but only really lurked in forums. I had this question that wasn't really sure where else to post it as I don't visit many forums due to time limits. A friend of mine suggested I try the forum here as he use to be active and said there was a lot of knowledgeable programmer who hung out here supporting RPTools.

My question is along the lines of Tile Based games and their programming and memory limitations. I'm a CS Major looking to get into game programming and was going to work on a side project of making a basic tile based map structure just to get my feet wet. But I had some questions from what I'd heard over the years.

First up going extremely retro is Master of Magic. I had heard the original reason for doing two different worlds was the limitations on memory. But from my limited experience in coding it seems everything has to be stored in memory. I don't see how making two worlds would give them access to more memory. I've done google searches on this several times over the years but never turned up anything other than the mention that it was done. As I'm always happy to learn new coding tricks I'd love to know exactly what was meant by this.

Second is MapTool seems to allow for unlimited grid size. I was wondering frankly how this is possible as many other tile based games, such as the CIV series, seems to be extremely limited in their size. Even going from Civ 4 to 5 the maps did not really seem to increase in size that much despite having lots more memory and CPU available. Though I slightly figure some of that is due to AI constraints, such as pathfinding, more than memory constraints.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Tile Based Games & Coding Questions

Post by aliasmask »

Two worlds? Do you mean two maps? When loading any single map all the images are cached for that map, and not the others. This keeps things speedy. As for the unlimited map size, I believe only what is viewable is rendered. I don't know the specifics and perhaps one of the MT programmers can give you more info. I just dabble in the MTSCRIPT language, not the actual java.

tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

Re: Tile Based Games & Coding Questions

Post by tiorthan »

I don't know anything about the internals of Master of Magic or why they decided to use two worlds. I guess that MoM uses a very limited set of tile textures and tile states. That allows for fairly tightly packed map data. Now I don't know about MoM but a Civilization map was less than 100x200 (I don't know the real numbers, they are probably lower) which is less than 60kB per Map. If Wikipedia can be trusted on this, MoM's memory requirement was 4MB so I don't think memory limitations were an issue.

Civilization Maps are not really limited by AI constraints. Current computer systems could easily manage much larger maps. The limiting factor is the concept of the game because the larger the map the longer the game. In a typical Civ game I would assume the map size to game length ratio to be quadratic or something.

Now as far as MapTool goes the map size is only "virtually" unlimited. It is in fact limited by two factors, the available memory for the JVM and your computer's data type sizes. MapTool doesn't use tiles at all. The grid size is used when determining token scale and the grid offset for modifying the position of snap-to-grid tokens but otherwise it doesn't have any effect ony the data at all.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: Tile Based Games & Coding Questions

Post by Lee »

Adding to what tiorthan said, back in the day MoM was released, it was a luxury (at least where I come from) to have 4096 MB of memory. Most PCs back then did fine with 1024MB. It wasn't far-fetched to say that having that much memory meant you were running a mid-range computer; which translates to the bulk of the PC owner demographic you were probably aiming for if you were releasing a more demanding game during those times.

People these days live in a memory glut and are "spoiled" by it IMO. I'm not saying it's a bad thing, it HAS driven innovation in many areas of making software as creators need not worry about blowing up the pot by putting too much into it. But it has taken something away from the discipline of making lean and efficient programs / code when one ceases to be overly conscious of how big one's program is getting. Though it was tedious, but it was also satisfying.

A hallmark of how great things can come in really small packages were the Elite games from Ian Bell and David Braben. While Frontier: Elite 2 was panned by critics as buggy, I never felt it got in the way of enjoying the game. Each time I loaded up those games, I am inspired to marvel at the little things that make all the big stuff work :)

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Tile Based Games & Coding Questions

Post by jfrazierjr »

tiorthan wrote:MapTool doesn't use tiles at all.
I would not go that far. In fact while you don't HAVE to use tiles(what MapTool would call "stamps") to build maps, it is FAR more memory friendly to use a small number of repeating tiles(same tile even if it's "shrunken" or rotated) vs doing an jpeg image import or direct paint in most cases. For example(and this is just an example with made up numbers to convey a point), if you were to create a forest of say umm 10000 trees in MapTool it using 10000 individual tree objects(meaning distinct png images from your resource library) would consume FAR more memory vs using 1000 individual tree objects with each duplicated(rotated, resized, or left as is otherwise) with each one copied 10 times. Likewise, using only 100 individual tree objects with each copied 100 times would drastically reduce the memory usage yet again.

By using tiles, you could make a "dungeon" structure FAR larger in the same memory footprint that the same dimension image from a jpeg imported as a background or "drawn" with MapTool's drawing tools.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

Re: Tile Based Games & Coding Questions

Post by tiorthan »

I should have been more clear, I guess. I was referring to the implementation of MT which doesn't provide any notion of tiles. On the user level you can, of course, emulate tiles with stamps.

Post Reply

Return to “General Discussion”