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.

2D All the way! / New to DB and have some questions

Author
Message
TymRavenblade
20
Years of Service
User Offline
Joined: 20th Jun 2003
Location:
Posted: 21st Jun 2003 02:55
I'm pretty inexperienced in programming... I have taken classes in QBasic and C, but for the most part I only do webpages and stuff.

A few friends and I are intrested in making a top-down RPG/strategy game (like Shining Force for the Sega Genesis.)

For the tileset, is it better to have one big image with all the tiles in it or to have the tiles as seperate images? Or none of the above maybe?

Also I know how to load images and use the paste image command... is this the best way to draw the map on the screen?
SRBrickman
20
Years of Service
User Offline
Joined: 19th Jun 2003
Location:
Posted: 21st Jun 2003 19:40
if it were 3D i would say seperate... i'm not entirely sure about that 1, if you're wrapping them round a cube to give a 2D effect to look at only 1 site I'd say seperate, if you're just going to position I would say joined.

TymRavenblade
20
Years of Service
User Offline
Joined: 20th Jun 2003
Location:
Posted: 22nd Jun 2003 22:16
Okay thanks. I have another question. I want the program to read an external file that contains the map info. For example I want it to be able to read a txt file that has something like this:

01,01,02,01
02,03,05,01
04,05,01,01
02,03,01,03

Where the number given represent a different tile and somewhere, I want to use two digits because I may have a lot of tiles for any given level. At the top of the text file I want it to be able to read a string or number that represents which tileset to load. I'm using the trial version of DBPro because I haven't recieved my order yet so I don't have a manual or anything to read. So I'm not entirely sure what's invovled in doing this. Right now all I know how to do is paste some tiles on the screen. I know I'll need to use some arrays to make it more effiecient. But I'm not entirely sure how to go about seting all this up. Does anyone know of any tutorials to look at that could help me out? Or if you have any advice that would point me in the right direction that would be great.

Thanks again.
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 18:03
I have the same prob with tiles, so I'm either gonna use SAVE ARRAY/LOAD ARRAY, or use ascii chars in the file which totals up to 256...But I think I'll need more tiles. If I find a way to do it, I'll give you the coding.

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 18:33 Edited at: 26th Jun 2003 18:34
Lucky you, I just figured it out for myself =D.


Okay, here is the parts:

Making the Array for the Game:
======================================================
DATA 3,3,3,3
DATA 2,3,3,3
DATA 2,3,3,3
DATA 2,3,3,3

dim Map(4,4)

for x = 1 to 4
for y = 1 to 4
read z
Map(x,y) = z
next y
next x

SAVE ARRAY "map.txt", Map(4)
======================================================



And now loading the array/displaying. (This code is beta for my game, probably needs minor improvements)
======================================================
dim Map(4,4)

LOAD ARRAY "map.txt", Map(4)

for x=1 to 4 : for y=1 to 4
if Map(y,x) = 538976257 then Map(y,x)=2
if Map(y,x) = 538976258 then Map(y,x)=3
if Map(y,x) > 64000 then Map(y,x)=1
paste image Map(y,x),x*32+210,y*32+120
next y : next x
======================================================

Hope the code works for you

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
dlefik79
20
Years of Service
User Offline
Joined: 26th Jun 2003
Location:
Posted: 29th Jun 2003 21:37
Hey morph, looking at this code, I pretty much understand it, but the question I do have is this, say you had a tile which is image number 32 on a tileset for example. How would you enter that info in on the data statement in the array? I'm kinda lost on the last part of the code though, where you load the array which is map.txt. Can you explain to me a bit clearer what that all does and how you got the values you did. I'm a real idiot some times so you'll have to forgive me.

TymRavenblade
20
Years of Service
User Offline
Joined: 20th Jun 2003
Location:
Posted: 2nd Jul 2003 10:17
Yeah what he said... and thanks for the help.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Jul 2003 11:47
I'd like to know what these huge numbers are in the middle.


Quote: "if Map(y,x) = 538976257 then Map(y,x)=2"


Where do you get those from?


Pincho.
Megaman X Gold
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location: Canada
Posted: 2nd Jul 2003 21:37 Edited at: 2nd Jul 2003 21:39
Wow, this is so similar to what I want I feel like I stole the idea from something ... other than how they did it in NES games, LOL! Umm...anyways...yesh...

I'm still unsure how -any- of that works. I look at a NES ROM hacker like TLayer and I see how the tiles are put into the game in a grid-style fashion. Section A1 of the map, accross 8 or so blocks to A8 and then starting a new row with B1. Anyways...with the arrays... Umm...

Okay, you have an array of say DATA 3,4,2,3,1,5,4,3 ...how do you specify and image for each of the values, and then rip the array apart so each specified tile-area on the screen loads that tile for you? And I wasn't quite hoping to have the arrays in a seperate file...but instead at the top of my program. And I also want to create on onscreen level display (which will be disabled in the final copy of the game) that will show the grid, screen locations and tiles so that we can easily go in and edit something in the map without having to look at arrays and try to remember what it looks like all the time.

The level-viewer would be say, an unreachable level. Like a level beyond the last level that users can't get to. The level-viewer will display the different screen locations by using the arrow keys to add/subtract to the posistion marker I want in my game (I think I can figure that part out, lol).

I umm...hope I was clear enough on that.

Life is more like a box of Grenades. Throw the pin instead of the grenade, and it blows up in your face...along with the rest still beside you.
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 3rd Jul 2003 12:22
Look at this code for an example:

Basically you load an image and give it a number say 1, then in your Data section every time you have a 1 placed there, it represents the image, the above code doesn't work for me too well but it gives you an idea.

I hear and I forget. I see and I remember. I do and I understand.

Login to post a reply

Server time is: 2024-04-20 08:35:18
Your offset time is: 2024-04-20 08:35:18