Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / DarkNOOBS Project 3: Adventure Game

Author
Message
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Apr 2009 01:05
Zelda style. I will help you out on this one.

Where to start:

First identify in your mind how it will work:

-At any point, the hero can attack.
-If there are no enemies nearby (within weapon range), nothing happens.
-If there ARE enemies nearby, check to see if they are hit (find out if they are in the AOE for the weapon)
-If the enemy is hit, their health will need to be depleted by some factor based off of the weapon strength.
-If the enemy's health is now below 0, the enemy dies.
-If the enemy is still alive, then he gets knocked back a little.

So, any one of these points can be broken down into MORE steps. For instance, point 1:
At any point, the hero can attack.
-Take input for the attack button.
-If the button is pressed, perform the animation and begin attack processing (every other step).

I assume you know how to take input from a button do something based off of its value, so this step is a breeze. Make the code for this, and we can move into step 2.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 14th Apr 2009 02:17 Edited at: 14th Apr 2009 03:13
Here it is but is'nt the animation thing for dbpro I've got db


Quote: "change the idle variable flag to 1"

what is that?it sounds fimilier

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 14th Apr 2009 02:43
sorta razer, anims arent extensive in DBC, but they do exist. Our anims arent the same as the animations in the help section tho, ours are a series of frames which r pics of the player in different positions that u cycle thru with a for next loop

in detail:

say the first "grid" of frames r for the idling sequence, the second is 4 movement, and the 3rd is the attack

each grid has 4 rows, each showing the character facing a different compass direction, and x columns, i 4get how many.

u divide the "grid" into many frame images

u check for the player moving (arrow keys pressed), if not then u take the players direction (variable 1-4) and take that row of the idling sequence and inc the frame variable, then show that frame on that row, change the idle variable flag to 1

if they move, then say if the idle=1 then idle=0 : frame=0, repeat for the attack variable flag. then we use the same sequence of incing the frames explained above to play the anim so long as the player is moving

a couple notes:

*remember that if the player is moving one direction, then another key is pressed, the directon variable should change accordingly, and maybe the frame shuld reset to 0, but thats ur call

*dont 4get that u also have to move the player according to the keys

and here are a few questions:

r the maps screen size or r they larger?

can we manipulate UV data on sprites in DBC like we can in pro? this would make map scrolling tons easier

is player movement pixel based or tile based?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Apr 2009 04:46
Quote: " ours are a series of frames which r pics of the player in different positions that u cycle thru with a for next loop"

This may be helpful... try and avoid using loops within loops. If you can cycle through your animations based on timing and within the main loop, you'll prevent actions that are animated from waiting on each other. If the hero swings his sword, if the animation is in it's own loop, then that loop has to end before an enemy can swing it's sword and vice versa. Start a timer when an action is intiated (which means several actions from different entities could be intitated simultaneously) and update the action each iteration until the end of a specific time.

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 14th Apr 2009 05:17 Edited at: 14th Apr 2009 05:18
ya i typed that b4 i thot about tht, actually i dont think im using a timer, im using the time from one inc frame to the next as one "frame"

so:



direction is a variable 1-4 telling the players direction; attflag,moveflag, and idleflag tell whether or not each action was the last one performed, if they are then we change the variable and reset the frame to 0 so the anim sequence will restart; the +400 and +800 are used in the paste commands to organize the code, as explained below:

say each row of frames is 16 frames wide, then we could paste the whole grid of frames at the start of the program, then use get image to split it into 12 groups, 0-15 are say move north frames, 100-115 are move east, 200-215 are move south, etc. then thru the math equation in the paste commands, it will paste the appropriate image at the right spot

so as i said above, the time from one paste image to the next will become one frame

this is not a perfect method, but i hope it will work

off topic, man 2 huge rants in a row, i gotta quit these, they hurt my fingers

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 14th Apr 2009 05:37 Edited at: 14th Apr 2009 05:40
sorry 4 double post, but this is unrelated to the above so im dping

btw bn2, i never heard u say b4 to make a world system, doesnt mean u didnt just means i didnt hear it

i thought the maps would be saved into an array, something like:

dim mapspaces(x,y,layers)

where x and y are the number of spaces across and down, and layers is of course the number of TOTAL layers we r going to use then we assign each tile of that layer into a value, so 4 the 1st layer, dirt is 1, sand is 2, rock is 3, etc

then if mapspaces(4,7,1) is 3 then we know that layer is rock

then we could fill in an equation similar to the one im using 4 the animation sequence above, where each layer of tiles is assigned a section value, layer 1 is 0-99, layer 2 is 100-199, these values would represent the image number of that tile

so we use 100*(layer-1)+mapspaces(x,y,layer)+1000 to find the image number of said tile (the +1000 is there to seperate these images from the ones in the anims i explained above)

then we just use a for next loop such as

for y=1 to (num of tiles map is tall)
for x=1 to (num of tiles map is wide)
paste image 100*(1-1)+mapspaces(x,y,1)+1000,(x-1)*(width of tile),(y-1)*(height of tile)
paste image 100*(2-1)+mapspaces(x,y,2)+1000,(x-1)*(width of tile),(y-1)*(height of tile)
paste image 100*(3-1)+mapspaces(x,y,3)+1000,(x-1)*(width of tile),(y-1)*(height of tile)
next x
next y

this would work if we had 3 layers (terrain, land features, objects)

something i just thought of, if we used:

dim mapspaces(num of maps,x,y,layers)

we could save ALL our maps into one array

btw could some1 post the animation grids and tileset(s) again so i can get started on my world system?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Apr 2009 09:13
I array could work, but would be VERY hard to follow. Perhaps different dungeons like so:

(Mapx,MapY,coordx,coordy,layers)

But it might be better just to use a couple different arrays to maintain clarity.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 14th Apr 2009 17:17
i see, we could get along with several arrays, just throwing ideas out here, btw wat r mapx and mapy in ur example?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Apr 2009 18:05
The map location itself in the dungeon. Sort of like a grid where every square is a map.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 03:38 Edited at: 15th Apr 2009 04:07
Good point from Latch about using animation flags instead of halting the program in a loop.
If you want to slow down the speed of the animation you can use a real number for the flag...

DB will convert a real to an integer when used to call things like images.

As for managing different animations I would do this...

can't read?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 04:06
Sorry have to double post.

As for managing different animations I would do this...

arrrgh damn text limits!

can't read?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 04:12 Edited at: 15th Apr 2009 04:14

Sorry about that being all over the place, I wont post long examples unless Im at a PC next time
Not even sure if it works, could someone test please.
Notice how I still kept my indentation even into a new post haha.

can't read?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2009 04:31
Going for a record here!
Sorry I have no choice.

I've started work on the map generator, it's just a skeleton really. I was wondering if we are going to have a mini-map for the player to use?
I'm trying to make it hyper editable so you can change the window size and zoom in/out which will help for the map editor. And the day before I randomly decided to make a scroll bar program so that will come in handy for this.

Got the music sounding pretty good (a bit pirates of the caribbeany ), can't find my recording thingy though so I'll have to wait till tomorrow. Sure I can do the music, my dad has quite a nice keyboard so I'll pop over there and record some things.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Apr 2009 05:34
sweet quad post obese, lol

btw these next couple weeks r gona b a bit hectic 4 me, between school, track, and work in the evenings, im not sure if i can find the time to code, so if bn2 or some1 wants to start a world system as well we could then compare our codes wenevr i get done

There are only 10 kinds of people in the world, those who understand binary and those who dont
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 15th Apr 2009 17:53
For the mapmaker is it possible to make it so we can flip through multiple tilesets to use for any layer instead of dedicating only one tileset to one layer?
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2009 19:00
I would think that that would be hell for the engine coders. Since each tile could potentially have its own tileset. Are you running short on room?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 15th Apr 2009 20:41 Edited at: 15th Apr 2009 20:58
I just thought it'll be easier that way, would you like to see an example, I can code one up.

Attachments

Login to view attachments
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2009 21:01
I am just thinking structurally, as I believe I know what you mean. The ONLY way I could see it working would be if a new tileset were generated to go in with the map, but that would bloat map (and therefore, game) size.

Or, were you saying one large tileset that is used across all layers?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 15th Apr 2009 21:13 Edited at: 15th Apr 2009 21:13
What I'm saying is that any layer can use any tileset, that way if we want to add another 100x100 tileset we can just pop it in and view or use it right away.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Apr 2009 01:10
Thats problematic, though. Since that would either 1) require multiple tilesets per map (creating problems loading and using them all correctly, since some maps have 1 and others have 5 or whatever) or 2) require a tileset generation process to package the tileset with the map upon saving, bloating its size unnecessarily.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 16th Apr 2009 01:23
Wait let me get this straight, I had thought that we would load up ALL the images we are going to use for the entire game at the start of the program.

Are we just going to be loading up images that an individual map requires instead?

If we load up all the tiles into memory they each will have a pointer and be easily accessable. If we decide to add another tileset then it's pointers will just continue right off of where it was left off.

I dont see the need of packaging tilesets as THAT will be bloating the size.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Apr 2009 01:36
Exactly, we DON'T package them, but we don't need to load all of them at once, nor do we need to include an entire tileset simply because a map uses 1 tile from it.

There are multiple ways of doing this. Personally, I would prefer to use a single image for the tileset of the current map and load it at the generation of the new map IF the new map uses a different one. If the map uses a different one, we simply replace the old with the new. That way, there is no need to keep track of image numbers for tilesets, there is just a single one that is used and re-used.

Why I would like this: less clutter. Plain and simple. We read the image name, load it from our library of tilesets, generate the map, store the image name in a variable for checking later. When the map changes, simply check IF NEWNAME$<>OLDNAME$ THEN LOAD IMAGE.... No pointer needed.

Also, this prevents us from needing to keep numbers the same across multiple programs.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 16th Apr 2009 03:08 Edited at: 16th Apr 2009 03:12
If you look at it from the making of the tileset point of view, there just isn't enough space to fit everything into one set. How would you know what tiles will go into a tileset ahead of time befor actually testing it out on the editor.

It's only while editing that you'll truly know what tiles you want to be included. Thus needing an easier way to add to the pool.

Tiles and array are already low memory usage, what's the point of being more conservative?

I still think static pointers are easier to use than dynamic pointers. It may take more memory (although little) but there's no loading back and forth.

[edit]

*sight* I'm sorry guys, about half this project's just arguments >_<. How about we just see more codes and see less talks?
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 16th Apr 2009 06:18
hey, @bn2 what about that battle system you were helping me with?

if you don't have enuf time it's fine

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th Apr 2009 06:26
a few questions:

r the maps screen size or r they larger?

how r the maps saved, meaning how is a .map (if thats the extension were using for them) organized?

can we manipulate UV data on sprites in DBC like we can in pro? this would make map scrolling tons easier

could some1 post animation images and tilesets so i can begin work on my world system?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Apr 2009 10:57 Edited at: 16th Apr 2009 10:58
You guys can tell me to but out since I'm not actually part of the project but maybe this will help.

I think both Ashingda and BN2 are right about the tilesets and what not. But maybe the approach is to have the map maker or map editor as it's own separate thing that generates a map file that is used with the game. What I mean is, the tile sets are only used for the editor, but a level tile set is used for a level in the game.

The editor is used to compile a level tile set that can be a combination of any of the generic tile sets. The organization of the tile sets is what makes the level tile set plausible.

Let's say there are 10 tile sets:
land
floors
walls
doors
trees
crossable water
non crossable water
inclines
declines
props

Whatever they may be; Each tile set could be 4 x 4 or however many individual tiles you want to include. Each tile set has it's own range. So maybe tiles set 1 ranges 1 through 16. Tile set 2 ranges 17 through 32 etc. The range dictates the type of object in the game world. The land tileset may be specifically for grass, roads, dirt, rocks, etc. and these things may all be able to be walked on. Trees maybe just that - trees or they could be other impassible objects like bolder etc. The point is to make a series of tile sets that have a particular purpose.

In the editor, there is a level tileset that you populate from the generic tilesets. It's size is maybe 10 x 8 (10 rows x 8 columns). Each row represents a type of generic tile from the specific tileset. Row 1 will only hold land tilesets. Row 2 will only hold floors, etc.

Once the level tile set is populated with at least 1 tile from the generic set, you can start to build your map. The map only references the level tile set. In the end, you would end up with 2 files - the level tile set that is a combination of the generic tile set, and a map file that describes how the tiles are organized into a world or level. This way, you can meet both Ashingda's and BN2s requirements for the game.

You only load 1 level tile set as you need it and you use specific static values to identify the type of tile. A map array that stores the tile number not only draws the tile on the map, but tells you the type of tile and whether it can be walked on, is a door to somewhere else, is an object that can be picked up, etc.

This also means that not every space in a generic tile set, or in the level tile set, has to be filled. As long as the structure of the level tile set represents different tile types, everything should work out. This also allows major flexibility in terms of impassable sets being used as passable objects.

For example, let's say you have a magic forest that is really an illusion and a player could walk through it if they tried. From the generic tile set of trees, you could put the tree in first row of the level tile set. Assumingly, the first row is land or a passable space. If the tree generic tile is place in the level tile of passable tiles, then the user could walk through the tree.

It's not to hard to manage layers from here either.

In short the process is this:
* Create an editor that uses a series of tile sets that have specific purposes
* Each tile set should be the same size and have a range that identifies it's type
* Create a level tile set where each row represents a type from the generic tiles sets
* Populate the level tile set with only those tiles you'll use for the level from the generic tile sets
* Create a map by picking tiles from the level tileset
* Save the level tile set as an image
* Save the map as a custom file type or an array
* In the game, load the map and the level tile set

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th Apr 2009 15:22
ya this is wat i thot we were doing, at least the .map file or array part, i vote for latchs plan, although im not sure if we need 10 subsets in each level tileset

There are only 10 kinds of people in the world, those who understand binary and those who dont
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 16th Apr 2009 18:24 Edited at: 17th Apr 2009 01:23
Okay sorry, it's kind of driving me nuts, and you'd get killed for this in Geek Culture (happened to me).

Smart Guy, please don't use text speech, spell out words, because it gives me, and I'm sure others, a headache.




Time is money. I just ripped you off.
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 16th Apr 2009 18:44
@Latch
I think this is packaging and I believe we ruled this out as it'll create more file size.


Bn2 doesn't seem to want to load tiles we aren't currently using whereas I can care less and just want every tile loaded.

So an aproach to dedicate only a tileset to a map was used but that's not easy for the tileset maker.


Suggestion:
How about we try using the multiple tileset as I suggested but only load the tile images that will currently be using, this should be easily coded.

Also I'd much prefer using the same tile pointers across the whole game it's less confusing.

We use tiles because it's able to be used and reused if we lock tiles only to some maps then this defeats it's purpose.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 16th Apr 2009 22:27 Edited at: 16th Apr 2009 23:03
RE: Tilesets
My view is we should only load the tileset we need, that way we can standardise things, i.e. image 1 is always the path texture, whatever that may look like for the particular map.
This way we can easily add new maps with new tilesets without having to go through the code and incorporate new image numbers.

[edit]
I think Latch's idea would work well and allow the flexibility Ashingda wants.

So in the editor you'd have a blank panel for tiles, then you'd click "create new tile"; select a ground image from the library, select whether the tile is traversable and click "create" and the new tile would appear in the tile panel. Then you could paste it on the map where needed.
We'd have two files: one file stores the data for all the created tiles (image and traversability) and their reference numbers would be stored in a separate map file. By using two files we can create generic tile sets for use in multiple similar maps.

@Smartguy
I'll get some 3D code so you can get started on the world thing.

can't read?
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th Apr 2009 22:55
I second OBese's point as it seems to make more sense. My idea of this project is that the engine itself should be as versatile as possible, because I think that we could use it again, and if re-using it means changing a bunch of constants, that just makes it a bigger pain to re-use.

Latches idea could work. I really want to stay away from having to load multiple tilesets at once in the map editor though. Perhaps we could write the interpreter part of the program to simply cut the image in half, that way we could make the tilesets infinitely large (10xinfinity) and have as many tiles as we need, while at the same time keeping a single tileset image. Then we compile a new one that includes only the tiles we use (hopefully it won't be too big) and package it with the map. I still think it will bloat the file size itself, but if we only include those tiles that we will use, there is less waisted data, and it will probably work a little smoother.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 16th Apr 2009 23:14
@BN2
Will we have animated tiles, like water?

@Latch
your advice is always welcome
we'll have to include you in the credits somewhere as Advisor or something

can't read?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Apr 2009 23:17
Quote: "Latches idea could work. I really want to stay away from having to load multiple tilesets at once in the map editor though"

There could be drop down menu from which you choose a generic tileset that replaces the current with a new one so you only load the tileset you want to grab an image from for the level tile set. But, you guys have your plans already - I was just throwing it out there. But, if you did create a level tileset from all of the available tilesets, that tileset could be used over and over with slight modification or none for any additional levels you create. The only real modification would be the map.

I know it seems that the thread has just evolved into argument, but it's really just the hashing out of ideas. However, at some point, the leader should say, "this is how it will be, period!" after weighing the input from the team; and the team should comply and do their tasks. It's rare for something to come out perfect the first time, so go with a method and see it through. If the product is not exactly what you want and it's important to you, rewrite rewrite rewrite.

Enjoy your day.
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 17th Apr 2009 03:38
so sayeth the referee, listen and obey!!

btw, we have a leader? who, prolly bn2 but ev1 has been helpful and shown leadership

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 17th Apr 2009 20:07
alright guys. since this is integral to the whole engine, let me hear your opinions on how to solve the layer/tileset situation.

please post what you think, its pros its cons and DETAILED info about how it will work

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Apr 2009 05:35 Edited at: 18th Apr 2009 05:38
@Smartguy
BN2 is the project manager for this project.

@Tilesets
I think we should save all tiles as individual images. Then we go into the map editor and design a level.
To populate the level we need to create tile types: select an image for the tile and select whether it is passable or impassable. This tile could then be plotted all over the map.
It could be stored like this...

When the map is saved a tileset image would be compiled from all used tile images.

I see the movement in this game being tile-based like pokemon so we only need a single value to tell us if we can go to a tile or not.

@Coders
try and write a mini-game that uses the routines and functions you are making for the project. It will make it more fun.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 18th Apr 2009 19:29 Edited at: 18th Apr 2009 19:34
my vote for the map stuff goes to the level tileset idea

i say go with 8 tiles per tile type and have one type per layer, howevr many layers were going with

i say 4 layers (terrain, terrain decals such as grass, collision, and above ground stuff) but theres been some discrepancy over number of layers so u guys duke it out and lets me know whos idea wins

could some1 post the animations and tilesets again so i can get started on my world system?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Apr 2009 22:06
Quote: "
i say 4 layers (terrain, terrain decals such as grass, collision, and above ground stuff) but theres been some discrepancy over number of layers so u guys duke it out and lets me know whos idea wins"


The idea here was that you would explain why so that I can make the final decision based off of majority and what makes the most sense.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 18th Apr 2009 22:37
wait, we need a reason for our choice, awww man

i just think that 4 layers would pull off a nice effect and not be too code intesive or hard to pull off

the number of LAYERS doesnt really matter bcuz if we save the map file to have k bytes per tile where k is the number of layers, then were talking a difference between 3*x*y bytes or 4*x*y bytes where x and y are the maps width and length in tiles, so 4 layers is only 1 and a third times the data size of 3 layers, not much

even the image of the level tilesets wont matter, unless we have a large number of tilesets, cuz if u figure were using 32 bit res. on those, thats 32 bytes a pixel, so if we go with my plan then each level tileset of 8 tiles wide by 4 tiles long, then each image is only 32*(32*8)*(32*4) = 1048576 bytes = 1 megabyte per level tileset. so even over a thousand level tilesets is less than a gig

so the 3/4 layers argument isnt going to make a diff cuz both are pretty small in terms of data

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Apr 2009 22:52 Edited at: 18th Apr 2009 23:12
@That1Smart Guy
Even less memory actually:
Quote: "using 32 bit res. on those, thats 32 bytes a pixel"

32 bits = 4 bytes per pixel
4*(32*8)*(32*4) = 131072 bytes (8 times less) so not much memory at all at 32x32 pixels per tile.

@BN2
I apologize for commenting when I'm not part of the project. My intention is to just to provide a couple of ideas. May I continue to post ideas or suggestions, or would it be better if I stayed out of the discussions?

Enjoy your day.
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 19th Apr 2009 02:57 Edited at: 19th Apr 2009 02:57
No, go away Latch. Nobody wants your expert help....

I'm sure we all love your help mate.

I do.



Time is money. I just ripped you off.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Apr 2009 06:05
@Latch
The nature of this team is that its open to everyone; so you are more than welcome to give advice and start arguments.
jk I'm sure I can speak for everyone when I say we are grateful for your imparted knowledge and wisdom.

RE: Layers
I am assuming that "decal" layers used to make more complex tile images are only used within the map maker and will be condensed into a single image on export.

It would be handy if in the map maker, when you import an object or terrain image the corresponding collision image would be loaded as well and automatically placed at the same coords on the collision layer. Maybe that would be part of my "create tile type" process, and adding decals and what not. Maybe it would be even better if once you had created a tile you could edit it "on-the-fly" by adding images to it on the map window and this would automatically create a new tile type. Yes and then when saved all the tile type images would be saved as a single image and blah blah referencing blah you know the rest

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 19th Apr 2009 18:31
nice spot latch, although ur math is now off, its actually 1/64 the size i thought (32/8=4 bytes per pixel) and we have two of those to convert so were actually dividing the whole thing by 8*8 or 64

so my point becomes even more true, nothing in this project will really take up much data space, so there little point in arguing over the number of layers, lets stop the arguing and go with 4 layers, now onto more important arguments.....

did we ever get the map maker to work, or r we still fiddling with that?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th Apr 2009 02:04
@latch: No, feel free to do so some more! You are a much better programmer than most (if not all) of us combined, so please, give us your input.

@irojo
Mapmaker is still in development, mostly because I need more info, namely:

1. Exporting: To be exact, I need to know what is needed. Do you just want 2 images (the map and the collision map), do you want a bunch of saved arrays. I was hoping the engine could be made at the same time so that its requirements would be developed and I could make the mapmaker output in the already coded way, but that didn't happen.

2. Basic map structure, which is what we are deciding on now.

It seems, though, that we will almost need to completely re-write the whole mapmaker, since a lot of stuff has changed since I made it. We should do it as a team though.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Irojo
16
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 20th Apr 2009 18:31
Quote: "@irojo"


O_o

I believe you addressed that to the wrong fellow.


Time is money. I just ripped you off.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Apr 2009 00:48 Edited at: 21st Apr 2009 01:24
Quote: "@latch: No, feel free to do so some more! "

Just making sure I wasn't stepping on anyone's toes.

Quote: "You are a much better programmer than most (if not all) of us "

Thanks for the praise, but I don't know how true it is! I just know a couple of tricks here and there.

Anyway, this DarkNOOBS team is probably one of the coolest things to happen around these forums. You guys, as a team, actually completed 2 projects that you set out to complete - 100% of your endeavors. You know how often that happens around here? Rarely! So many teams have come and gone with basically nothing to show, so keep up the good work! You guys are obviously doing something right.

A little more detail on the level tilset method:
The level tileset idea functions on the premise that from a series of predefined tilesets, you select tiles to add to a single master tileset for a level. Once the master tileset is created, it can be used over and over again for any other levels, or an entirely new level tileset can be created for any other level.

"Why not just have generic tilesets for all the maps? Interiors use the interior tileset, exteriors use the exterior tileset etc?" someone in the audience asks.

Flexibility. The master tileset defines what a particular tile is. This can make a collision map unnecessary. This also allows any tile from the generic tileset to be any type of level tile. You could have a tree in a dungeon if you want, or you could have walls in the forest. The tile types identified by the level tileset do not have to be limited to just a picture of whatever the tile is, they can be triggers for anything. In a 16x16 master level tile grid, say, you can have 16 types of tiles and each type could have 16 different pictures.

You could have one of the tile types that represents messages. So if the character moves onto or tries to move onto that particular tile type, a message will be displayed. You can have tile types that act as doors or telportals that bring the character to a new location. You could tile types as simple as impassable or passable so a player can or can't move there. You could stack them as well to trigger multiple events when the character moves on a single square.

For the map, the map is an array that keeps track of which tile(s) from the master level tileset is where. For a map of 100x100 tiles, you may allow 16 layers or stacks of different tiles. So your map array might look like
dim map(99,99,15). The highest index of the layers is the displayed tile. If you use transparency in the images, then it could be a combination of tile pictures. If you want triggers, you don't necessarily have to assign pictures to the triggers in the master level tileset. A black square would do. That way you could stick a trigger on top of a tree, and not worry about the tree being covered.

The programming for this method could be a little tricky depending on what you want triggered by attempted movement on a tile. If it's a passable tile that does nothing, no problem. If it's an impassable tile that does nothing but keep the player from moving there, no problem - you just get the value of the tile from
type=map(x,y,L) where L=0 to 15
If type is a passable type blah blah blah
If type is an impassable type blah blah blah
But if type is a message, then you'd have to have a way to associate the message with the map position, and the particular type - and control when the message plays. You could just delete the message tile from the map after the message plays, or figure out a method to play it when the character moves there and not while the character is standing there (if it's also on a passable tile).

Anyway, that's the basics. Once done, the system lends itself to be very flexible. You might even want to include a paint program for the master tileset creator so you can choose generic tile pictures or paint new ones, or a combination.

What is saved would be the master tileset as an image
The map file with the x,y,L coordinates
Within the map file, appropriate links to other tiles or the loading of other maps if the layer type is a doorway or teleport.
Any links to text or text files if the tile type is a message.

The master tileset structure can be anything you want. Passable tiles and impassable tiles may be all you want to help with collision.

Enjoy your day.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Apr 2009 02:36 Edited at: 21st Apr 2009 02:40
This reminds me of those games where you can make your own scenarios by creating a map and placing objects and triggers.
Are we making an RPG maker now?

So how are we going to store all this data? For each tile we need to store several images (layers), whether the tile can be walked on, any actions that the tile executes.
The actions seem tricky to me; If we wanted a message to appear when you walked onto a tile we'd need to store a flag for the tile that indicates a message needs to be displayed, we also need to reference the particular message required.

Well if you want to go down that road I'm sure it's do-able and it would mean we could make a long story without too much extra work. Hey we could even make the sequel with this editor

off topic: I just found out that -1 is white!!

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 21st Apr 2009 03:09
Quote: "off topic: I just found out that -1 is white!!"

?

u mean that ink -1,0 would be white on black or r u talking something else?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 21st Apr 2009 05:40
For the action tiles (messages and such) I was thinking we could use the entity layer. Have it trigger when the hero touches it and store the data in a separate array. We could have it store a string, an action code, or anything else. This method could also be used for teleports (tiles that will trigger a switch map), npcs (monsters, townspeople, etc), or anything else.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Apr 2009 12:22 Edited at: 22nd Apr 2009 00:16
[EDIT]
To start, I'm not a newbie. I think this is great thread because you guys see things through so I thought I'd throw a couple of ideas in the mix. I don't want to scare any newbies away if what I post seems too difficult; these are only some ideas. You can take them or leave them. I'm not trying to tell you how to do anything. If I post some code, look through it and see if it makes sense. If I make a mistake or seem to be doing something the hard way, feel free to give me what for!

Also, I keep talking about 16 layers. It's really just an arbitrary number. It just to show it can be done with little overhead in the map design. It could as easily be 4.

@Obese
Quote: "So how are we going to store all this data? For each tile we need to store several images (layers)"

You don't actully have to store several images on a single map square. The master level tile set holds the images that can be used on the map. A map array, holds a reference to a particular image/tile. The layering only holds the reference to the tile as well. The master level tile set is always numbered the same, so you know what the tile type is by the number that is referenced in the map file. The picture (image) is in the master level tile set. If tiles 1 - 16 are passable tiles, those pictures could be anything, blank spaces, a road, grass, shallow water - anything.

The tile number from the master level tileset is stored in the map array. The actual in game map can be drawn on the fly - tile by tile, or predrawn on an offscreen bitmap, or partially predrawn and updated as movement occurs, or drawn and saved as a a picture file (though that may be huge depending on the map size - jpg, bmp, png, etc.) - any number of methods could be applied (I like having the initial visible area predrawn offscreen and then just updated as the map scrolls into or out of view). The only visible image is the last one drawn, so if you had a stack/layers of 16 images, there would ultimately be only 1 displayed (using transparency - a composite of all 16 images).

I knocked together a quick example. I didn't create a nice neat layout for a master tile set, I just created 3 images in memory that can be used as tiles. The map editor will allow you to stack 16 layers on a single tile. It won't allow you to have 2 of the exact same tile overlap because that would waste layers. However, you could alternate between 2 images and fill up all 16 layers if you felt so inclined.

If you point at a position on the screen, it will tell you the x,y tile position, the number of layers used on that tile and which tiles/images from the master tile set are assigned to that layer. The highest layer number is the one on top for the map. So you could lay down some grass, then put a road or two on top of it.

Using this method, you could check through the layers to see if there was an action tile (by master tile number) and then trigger whatever is necessary based on the x,y tile position.

Feel free to put tiles anywhere on the screen. The information text will still display on top.

Here's the example:



I may be missing something in regards to your intents by this approach all together. Hopefully it's helpful.

Enjoy your day.

Login to post a reply

Server time is: 2025-05-17 20:23:46
Your offset time is: 2025-05-17 20:23:46