sparky4 / 16

A 16 bit style game on the 16-bit IBM XT
GNU General Public License v3.0
24 stars 3 forks source link

Development roadmap and direction #7

Open joncampbell123 opened 6 years ago

joncampbell123 commented 6 years ago

Contributions may be easier to come by if Sparky4 can use this issue to communicate what needs to be done next. I am opening this issue as a sort of "forum of discussion" to enable that.

I'll start.

I don't recommend using VGM as IMF is much simpler and easier to implement. I have opened an issue in DOSLIB describing a tool to read MIDI and generate IMF (re-using the code in hw/adlib that already plays MIDI with OPL2 commands).

I also recommend writing a rough draft of the story behind the game. It doesn't have to be perfect, just put the base idea out there. Changing the story as the game develops is allowed. If all you have is a outline, a list, that's fine.

Other users on Github, especially those with an interest in this game, are welcome.

Sparky4 is on IRC on server 4ch.mooo.com in chat room "yotsubanome" if you need to ask her questions directly, though she's not always online.

Let's give this game direction, or if it already has direction, make it apparent to those who wish to help! Some discussion required, so let's talk! Others who wish to talk here, go!

sparky4 commented 6 years ago

I been so busy with math 242 that just noticed this! Also it is her! not him! wwww

joncampbell123 commented 6 years ago

Correction made, sorry about that!

sparky4 commented 6 years ago

it is ok! i am studying for exam 2 of math 242! also how to get sdtest.exe to play music? (i did not make the variables project 16 compatible yet.... because i need it working and need to know what needs to stay as an in file sctuct of variables like in 16_in)

joncampbell123 commented 6 years ago

The quickest way would be to get some IMF files and write it to play that. Then music playback becomes a matter of timer ticks and raw register writes to the OPL2 chipset.

sparky4 commented 6 years ago

i think it is the ticks and register writes

the code has been written. but i ported it to open watcom... so i do not think it works...

joncampbell123 commented 6 years ago

I wrote that code in Open Watcom. Are you sure? :)

sparky4 commented 6 years ago

it is id engine code, silly!

it is located in src/lib/16_sd.c

sparky4 commented 6 years ago

ah yeah for testing reasons. getting borland c to be able to run the graphical stuff of the memory again...

sparky4 commented 6 years ago

I gotta work on getting the joystick stuff working again. and the palette manipulation stuff i been putting to the side too long. and more stuff but i cannot remember at the moment. besides actual engine stuff.

joncampbell123 commented 6 years ago

For those who want to help, how exactly do you intend your palette manager to work? Will it allocate in blocks or groups? Multiples of 4, 8, and 16?

EDIT: I mention 4, 8 and 16 as examples. You could simplify your palette manager if you allocate and manage in powers of 2 with each block starting at a power of 2.

sparky4 commented 6 years ago

ok the palette stuff. this is rather long.

The palette is an array. so.. the file containing some explanation is src/palllist.c

An experiment where I make 2 small linked list which points to 2 arrays

one is the "hardware palette" array the other is "image palette" array and their respectable pointers point to their [i] values

the palette updater stuff i want to make is this:

these are 2 arrays with some duplicate values

VGA={*,1,2,3,4,5,6,7,8}; //( is the overscan color which is not manipulated by this process) IMG={*,23,4,2,0,9,0,}; //if the is duplicate index values in the image for some odd reason. (* is supposed to be the transparent color of the image) [this is a very messy palette]

    MERGE THEM INTO

VGA={*,1,2,3,4,5,6,7,8,23,0,9};

the merged colors is below *

the matching colors of the image with vga palettes are merged. This should also change the matching numerical values in the image to the vga palette of same color.

and for the non matching colors. These are placed at the end of the vga palette and the images index number of the pixel is changed to new number values of the newly added color in the vga palette.

//wwww

that is the theory but i have not been able to code it because. wither 2 busy (in class while making this) or my code was horrendous and complex!

What makes this so difficult is the RGB part. every 3 colors is an index on the vga palette...

sparky4 commented 6 years ago

also the drawing of sprites in xcroll are not fast enough on my XT on turbo mode.... i do not know why

sparky4 commented 6 years ago

omg I been way too busy and TIRED

sparky4 commented 6 years ago

quarter ending in a week so... i will pick up on coding again sometime~

sparky4 commented 6 years ago

I got some plans and such including the engine core stuff and offset array (like wolf3d's). going to use a bunch of code from wolfenstien 3d

Ruedii commented 6 years ago

For sound you should look into implementing some of the advanced PC speaker sound algorithms.

This involves timeslicing to convert the sound, the use of sample files, or the use of compressed sample files that use a timeslicer to decompress.

The easiest and highest quality way is to encode the sound into a high frequency supersonic overtone. However, this method is very processor consuming, as it means you are operating the event timer for sound generation at a very high speed. That said you can operate all high-frequency timer-based preemption on this cycle. (Low frequency operates on the H-Sync (hardware), V-Sync (hardware) and Frame-Done (internal software) interrupts.

However some lower quality core timer chips drop their highest frequency registers, and some PC Speaker controllers can't be operated at that speed. Because of this you need some sort of fallback.

joncampbell123 commented 6 years ago

It might be simpler if @sparky4 were to just use Sound Blaster digitized speech if available, and implement PC speaker effects later.

Focusing on all the neat tricks you can do with hardware will prevent you from writing the awesome game you want to make and it will never happen.

I'd rather see what awesome JRPG or whatever idea @sparky4 wants to make. It might be an awesome story. PC speaker tricks and hardware tricks come second. I would say that's more important than getting a full framerate, which considering the target is XT hardware, probably won't happen for awhile.

In fact, I think a better approach to this game is to make the first version and note what you're not happy with, and then some years down the road when making these games has improved your programming skills, you can go back and re-release this one with the faster, more optimized code you wanted in the first place.

joncampbell123 commented 6 years ago

@Ruedii Sparky has been pulling in source code from Wolfenstein 3D to try and build on, so it's possible it may inherit Wolfenstein 3D's fixed tick rate (also used to drive the Adlib music if I recall). However the tick rate is high enough to allow for some good PC speaker sound effects.

joncampbell123 commented 6 years ago

@sparky4 Speaking of JRPGs, you may also want to check out DOSBox-X. Since last November, DOSBox-X has a PC-98 emulation mode and many common games run perfectly fine in it including Touhou Project.

sparky4 commented 6 years ago

!! i just noticed this! yeah i am working on other things.. i was not able to code much for like 9 months because classes been rough.. especially last quarter!!!

sparky4 commented 6 years ago

aww yeah this is a cs class!! wich means i can code... if i am not so facking tired.. lol @Ruedii we do not even have a engine core.... i mean you can help out with that.. i was going to use the very VERY core stripped of everything of wolf3d engine and related engines.. also i have no idea how to do the map system coding.. also _CA is huge headache zone

sparky4 commented 6 years ago

also from the commit from a year ago

16_ca needs huge amounts of work and I should remember what needs to be done soon[going to port rest of code to borland c some time so we can use the core components of id engine here ][going to add 16us.c eventually but the debug system and CA PM and MM usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] added 1st scroll back [i work on CA] palette debug show values added wwww and i need to know how to see vrs/vrl imaage data palette index numbers [i am trying to find out how the hell you get the index number values of VRL/VRS] boom has been fixed ^^[CA_CacheMap added seems to be used in start a new game] what is mapsegs?

joncampbell123 commented 6 years ago

@sparky4 Regarding VRL don't forget the hw\vga\vrldbg.c source code which demonstrates how to parse VRL.

sparky4 commented 6 years ago

i need to bleach vents again... my mind is too foggy and tired and it wakes too much effort to THINK ^^;

@joncampbell123 i did not fully work with that yet. i just never been able to get around to do it. you know super math and very tired foggy head. and 8 am stuff. i need to bleach vents my head is too foggy that hard math is over. so i should have more time but i gotta do that special thing because my head works better afterwards!

sparky4 commented 6 years ago

i should do the wolf3d core core stuff and finish testing the joystick... i am forgetting what i have done..

sparky4 commented 6 years ago

I don't have time AND energy anymore >-< it is ALL being used up by school. this quarter is the descrete math which is entirely new to me and there is no tutoring or such so i have to burn al ot of time and energy just to make a C! >-<

sparky4 commented 6 years ago

school has been pummeling me so badly. I been sleeping 12 hours everyday during this break if i can due to me not being able to rest from super stress. I am just catching up. also i have not been able to code for a year. i can sense more fucking math on the way. Hopefully this winter i can code.

sparky4 commented 6 years ago

i gotta work on the core core (the actual game engine looping part. stripped to the most minimal of minimal. of just a loop and 16_in with a fuck load of //++++ [which means add this later] and then slowly add the 16 parts and then menu and so on) the cache manager is the biggest blockage for me to successfully get p16 into alpha phase wwww. also class is starting back tomarrow. i can barely code! it just shows the state of my mind from all that calculating

joncampbell123 commented 4 years ago

I just updated the hw\vga VRL converter code to add a PNG to VRL converter. The PNG must be paletted with 8-bit depth, of course. The benefit over PCX is that one color can be explicitly set in the PNG as the transparent color instead of having to specify it manually.

joncampbell123 commented 3 years ago

There's a Discord server about DOS games in general you might like.

They have a channel on DOS game development that might be of use for Project 16.

There is another channel on this server for the seasonal DOS games jams, if such a thing might help with game dev.

https://discord.gg/thmqvDf

sparky4 commented 2 years ago

thanks i will check it out!

sparky4 commented 2 years ago

hey umm i need assistance with 2 pal files, merging them, removing duplicate color values, and changing the image index color number to match the original palette's color. like a array merger of removing duplicate colors. the code is paltest.c but it is messy and i forgotten how it works.

joncampbell123 commented 2 years ago

I have a program to match colors to a common palette for PNG files here. Written for Linux, may compile elsewhere with some work:

https://github.com/joncampbell123/doslib/blob/master/games/dgjamfall2020/codenamesunfish3d/tool/pngmatchpal.c

I wrote it because ImageMagick has a bad habit of matching to a color palette, but arranging the color palette per converted image in whatever order it feels like, and GIMP (GNU Image Manipulation Program) will shuffle the palette a bit if you load and save a PNG and one color is transparent. This game jam entry needed sprites with a consistent color palette to work. Yes, it uses VRLs. Although it also uses a very minimalist PNG reader library using ZLIB and the PNG spec that I wrote, that is able to run entirely in 16-bit real mode MS-DOS. The fonts in the game are PNG as well, generated by a Windows program that renders fonts to 256x256 TIFFs (intended obviously for OpenGL/DirectX games that need fonts).

sparky4 commented 2 years ago

whoa! that is so cool! thank you so much <3 i will work on bcexmm.exe soon along with this

sparky4 commented 2 years ago

is there a vrl version?

joncampbell123 commented 2 years ago

No, but you could use it to ensure all PNGs have the same palette, then convert each PNG to VRL. The VRL code reads from data you load in memory, so this game project of mine packs the VRLs into a "package" file and reads out the one it wants at any time.

sparky4 commented 2 years ago

oh the game engine would do it on the fly on vrl files not pre processed

sparky4 commented 2 years ago

i actually have a question should i keep all variables used in the game engine here? static global_game_variables_t gvar or in the original id engine variables?

i been debating this since 2018

joncampbell123 commented 2 years ago

It depends on the variable names. If they're short names and potentially easily confused with local variables, a gvar struct is a good idea. Otherwise, either way is fine.

sparky4 commented 2 years ago

it makes porting the ID engine components to be a pain in the butt.. i think a hybrid of the 2 variable stuff should work?

sparky4 commented 2 years ago

https://github.com/mills32/Little-Game-Engine-for-VGA i found this engine... i should give it a look when i get some time too

joncampbell123 commented 2 years ago

Nice. The README suggests it does a lot of what I've suggested doing with unchained VGA 256-color mode. Have fun.

sparky4 commented 2 years ago

oh like what?

joncampbell123 commented 2 years ago

Remember when I said it might be nice to compose parts of the screen in non-visible VGA memory and then Write Mode 1 32-bit copy to visible memory?

Also VRL's formatting is optimized for drawing in 256-color unchained mode. That's why it's made in vertical strips, to minimize the I/O writes to the VGA hardware, and it's indexed on load so you can render every 4th strip for each VGA bitplane.

sparky4 commented 2 years ago

oh? like a vram buffer? for parts of screen in a page not shown? no idea how to do that with out exposing that section of the screen with the scrolling with out constant updates?

sparky4 commented 2 years ago

also i am a bit rusty with the code i been through alot of psychological (litteral psychosis delusions) issues in the 1st half of 2019 and i was taking a recovery break from the project to focous on school. i come back to some of my code i made and it is messy quick and dirty mess. thats hard to read. i need to practice again.

sparky4 commented 2 years ago

also i cannot compile png2vrl due to issues with the png library not being found

joncampbell123 commented 2 years ago

If you're on Linux, you can compile libpng, make, make install, or most distributions have a libpng and libpng-dev package for both libraries and headers needed to compile code against it.

If you're on Windows, you can get libpng and dev headers for MinGW, or compile it yourself.

If you're using VS2019 on Windows, you'll have to compile libpng yourself to get it to link to the program.

joncampbell123 commented 2 years ago

You could allocate some part of video RAM at the end, and then make sure scrolling never goes down that far.

My game jam entry for the most part never goes past using 128KB of VRAM (32KB planar) anyway unless absolutely necessary.

sparky4 commented 2 years ago

oh interesting... i just have no idea how todo that the allocated memory part to never scroll down there part