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 / some ideas

Author
Message
DaktaV2
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 6th Nov 2005 01:15
We all know that many people here start projects that go nowhere, myself included. So what i\'m considering is making a small (well medium sized) peice of code that will read a text file line by line (each line represents an objects perimeters) and just produce a world with the text fiels description, a very simple way of saying its a map format, except with preset objects, for example a text file could look like:

1,0,0,0,100
1,100,0,100

Where the first number could represent a basic floor tile, the enxt 3 give the position and the last give the final size of the object, which hopefully would result in the creation of two floor tiles next to each other (both 100 coordinates square).

The idea of this is to basically make the production of okayish maps simple to do for myself. I am not a modeller nor a mapper. I\'d rather spend the time doing things such as weapons programming than making maps. So it would be great if I had this code to reuse in all my projects, cutting development in half and probably increasing the liklihood of success in a project.

This won\'t be easy, and I don\'t want to ask you guys for code since this is something that i want to acheive for myself. However I do ask for any suggestions and opinions, I have thought the idea through and the level parsing code (or the code that would load the level file) would have a structure like:

Pseudocode: (Plain english code-ey stuff)
for textline = 1 to end of file (basically read each line at a time)
get characters up to first comma, put in variable objectnum
get characters between first and second comma, store in variable objectpositionx(textline)...

at the end of each line it would produce the object and once it reaches the end of file it wil lstart rendering with the SYNC (and the game would start).

I would use numbers for objects, and there could be code put into the beginning of each game to give a certain object file a certain number, like if objectcode = 42 then load object etc.

Like I said I havent thought this through fully. I would also like to be able to pass perimiters such as transparency, culling etc..

Anyway give me your trhoughts, is this really a realistic ro acheivable goal?

Kris

Have you ever put gloves in the glovce compartment? Didn't think so.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 6th Nov 2005 11:33
yes...and no, too many objects (IE individual floor tiles) would slow your world down a lot, but you can do things like that, imo the better way would be to make a simple world editor then rather than store the data as strings in a text file have the editor save and load the file format as numeric data, no long winded conversions etc, but many people find it easier with saved string data, whatever rocks your boat , all you need to do is to make sure that the file format you use is robust, that is, it only reads the data it requires and doesn`t overun and get out of sync, for example you use fixed size chunks of data, or you have a 1 or 2 byte header for each chunk that says how large it is, the details are down to you realy.

I constantly make small editors for games, an editor does not have to be rocket science with drop down menus and graphical object selection, many of mine have simple key controls (echo`d to the screen) and save or load the current file when you press F11 or F12, just that simple, when I start on the next level I just save the finished one somewhere else after renameing it, simple, no menues or fancy displays, I even stick to editing just one aspect per editor, terrain in one, building positioning in another (often has it`s own requirements), objects in another etc, imo too many people spend months creating editors when the time would be better spent on the actual game, heres a very simple editor that positions wall blocks for a maze game.




minimalist, but it only took 15 minutes to write, thats more time to spend on other things, so, yes! go ahead with your idea, it will work just fine, if you want to stick to using a text editor then you might want to place different values on different lines rather than seperating them by commas, easier to read, just read a line and convert it to a number, the file will not be any larger for it.



if there is one thing I can NOT tolerate, it`s intolerant people.

Login to post a reply

Server time is: 2025-05-22 14:11:12
Your offset time is: 2025-05-22 14:11:12