Tilebased Map: what way to make?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Tilebased Map: what way to make?

Post by Bugala »

I am thinking of making tile based map (ie. Ultima, Civilization).

When I am planning to make non scrolling, static map, what way is best to make it.

From programming point fo view i would favor in putting tiles as brushes and just pitting enough brushes to cover the shole screen.

However, woudl that be too slow? Especially when im planning to make it in HD resolution (1920 x 1080/1200)


I am also thinking this solution because it would give me easiest way to later implement effects and even scrolling if i so decide.

But if brushes are put to screen to stay still, although there are some other (characrter/enemy) brushes that will be moving, does those still brushes slow
Hollywood hefily down, or are they maybe as light as Using Brushes to Draw to screen directly would be?



Or any other good ways to make the tilebased map?
ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

Re: Tilebased Map: what way to make?

Post by ArtBlink »

Hello,

I have post source code of my multidirectional scrolling in this forum, i use my own hack. I can make fast multidirectionnal scroll but only in 640x480, other this resolution, my engine is too slow, don't use sprite and layers, too slow, don't use double buffer... it is too slow.

My hack is, i create brush in 640x480, i display in all of my gfx (i use table, the number in table is id of the brush).

Look my script here:

viewtopic.php?f=20&t=221

you must delete FLIP and begindoublebuffer command, and just before displaybrush command write selectbrush(Number of your brush in 640x480)
After all displaybrush command, insert endselect and wow, the engine is faster ;-)
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Tilebased Map: what way to make?

Post by djrikki »

Buluga,

I don't know about the draw side of things off hand as that can be quite involving, only to say that yes a EndDoubleBuffer(),Flip(),BeginDoubleBuffer() solution will work just fine.

As for the map data you'll need a structure you'll need like so:

l = 1 ; map id/location in the game
x = 50 ; how many squares wide is this map?
y = 30 ; how many squares high is this map?
z = 1 ; if you plan to have elevators, stairs, sky level, ground level etc...
s = 1 ; square states: a normal square that can be walked on, solid state: eg. water can't be walked on, a door, an item that can be picked up, an item that can be manipulated e.g. a lever, a shop etc

Dim map [l][x][y][z][s]

This structure will leave you able to add scrolling maps at a later date. Start small build a map with grass on it, water, walls, doors and then work out how to stop your character walking on squares he cannot. Only then proceed to more advanced stuff like interaction eg. with levers and doors, items that can be picked up etc...

Once you have all your images done, you'll probably want to make your own map editor so you can get going asap so you can populate the world.

In general its best to define all your data structures in full from the outset so you don't have to make lengthy changes down the line.

Other things to think about:

Your character: Name, Age, Level, Religion/Alignment, Profession (eg. Warrior, Wizard, Cleric), Number of Body parts that can have armour/weapons installed, max items that can be carried, Weight, Height, Strength, Agility, Intelligence, Mana Points, etc....

Then later the spell/weapon system, the story, communication system with NPCs, the list goes on...
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Tilebased Map: what way to make?

Post by Bugala »

Although I didnt get quite the answer i was looking answer for, thanks anyway from the tips.

My idea of making a map structure was much harder than your version Rick, thanks from that. I will use it partly instead of my original plan.
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Tilebased Map: what way to make?

Post by Allanon »

Hello, since you are talking about static maps you could implement soemthing like that:

- Background picture: not tiled, one big picture with your static map
- A table with active areas, you can describe here what actions could perform the player
- A table describing the objects on your map, these could be rendered in order to represent an isometric perspective. These objects could be even animated to make your map "live".
- Another table to describe object to render on the top of all other graphics, for example to simulate cloud shadows, sun rays and so on

This is just a quick idea about the approch you could use for this kind of project :)
Post Reply