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 Professional Discussion / Pauses during midi loop and questions about file access

Author
Message
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 25th Dec 2004 08:55
As you may or may not know I am creating an 2D RPG Game. I will be working on writing a map editor this weekend but first i want some insight.

My first problem is that in my little test program (which only includes the screen tiled with 1 tile and a sprite for the walking character (either male or female). Everything there works fine, except when the midi comes to an end, then when it goes to loop the sprite pauses walking (walking is done via arrow keys) for a split second. Any way to fix this?

Secondly since i will be working on the map editor, i really want some insight into what you think would be the best way. First of all i dont want to be limited to 256 tiles per map, so im thinking of allowing 5 tilesets per map, with each tileset containing on average 300 tiles, but as many as 1000. The tilesets will be brought in as a single image (one per tileset). Im currently using PCX as the format, is there a format that dark basic handles faster.

Finally, and most importantly is the actual map format. I plan on having a single file contain basic info on the map, and quadrant info. Basically a map can be indefinite in size, so its split up into quadrants. 20x15 tiles in size (what can be put on a 640x480 screen at once). Each quadrant will occupy its own file. Each quadrant will have three files, the tile file (contains which tiles to use stores in the format of ascii characters 2 bytes per tile.) Then there is the use file (which stores what tile tpype it is, such as walkable, blocked, underneath, chest, special, high grass, etc, probably stored a single ascii character per tiles). Then finally the sprite file which will store info on building, characters, doors, warps, etc).

Basically program wise. The map is flowing, meaning the user will not see any transition between quadrants. 9 quadrants will be in ram at once, when the user exits the second quadrant say going down, quadrants 1(upper left),2(upper middle),3(upper right) will load from files the next quadrants in the dirrection the user is walking basically quadrants 10,11,12. The quadrants will not be resorted in RAM, but instead an index variable will keep track of them (much more effecient).

My questions, as this is my first testings with DarkBasic. Will it be able to handle the file reads, bitmap copies, and still keep the music flowing and graphics flowing. And can anyone think of a better way of doing this. This is my first RPG, so i have to past experience with map files.
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 25th Dec 2004 11:38
I have discovered that the midi pausing is an issue with db by looking through some posts. So im gonna convert them to mp3. Now I would prefer to use some kind of free software, but if need be, i could just loop the line in to the line out on my sound card.

But
1. Does anyone know of any free software (not shareware)
and
2. Any ideas on my previous post.
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 25th Dec 2004 12:54
if you get a hold of decent string handling funcs, try to use strings instead for a variable number of layers. ive heard that there are more than 256 chars but do not know what they could be.
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 25th Dec 2004 13:30
Well ASCII characters will be strings. And yes there are 256 of them characters 0 through 255.

My tile files will contain 600 letters. 2 characters per tile or basically giving me a max of 256x256 or 65,536 unique tiles per map.
Although i never ever dream of ever using more than 5000, if that

My tile type file will contain 300 letters. Basically giving me 256 different uses for tiles.

My sprite files will contain only locations of sprite characters and their graphics to use.

Ill have a fourth file which will contain on demand data, such as what the npc's say and whats in the chests. And what the special tiles do. This file will only be used if the player interacts with the sprite or opens a chest or lands on a special tile.

The first three files will be loaded into ram for each of the 9 quadrants. The fourth tile will be loaded only if needed, and even then only for the current quadrant.

Im sure your gonna ask, what if a npc moves out of a quadrant, well, this will be permitted and kept track off.

Now since this is text basically, is there a way i can load the entire file to ram (its more than the 256Byte string length). And will db be able to keep up with the conversion of bytes to numbers.

Like for the first file, ill have to do this for each of the 300 tiles:

IntArray(x)=ASC(Byte1) * ASC (Byte2)

And for the 2nd file

IntArray2(x)=ASc(Byte)

Can DB keep up with this and still play music and still do the graphics?

I dont really want to invest much time in this project under DB, if DB cant handle it. Wont make a difference for the map editor i make this weekend, but after that i want to be sure DB will work, otherwise ill goto C++ (rather not though)
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 26th Dec 2004 12:58
you could use memblocks and use ian mold's async plugin to play music and load stuff simotaneously.
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 27th Dec 2004 03:41
I tried doing a forum search for this async plugin, found nothing. Where can I get/find info on this plugin.

Thanks

Login to post a reply

Server time is: 2025-06-09 03:59:34
Your offset time is: 2025-06-09 03:59:34