Page 2 of 3

Re: Project: A new game for DOS. Want to help?

Posted: Wed Feb 21, 2018 9:02
by KeenRush
I got thinking that I might try to implement a very simple version of what I have in mind just to so see if I can do it. If I do it, I'll release the source and it can be used for or by other projects. My engine won't have music or sounds because I don't care, nor will it have advanced anything. I also set myself a challenge: I will try to make the engine in less than 500 lines of code -- simply because I think it can be done so.

Re: Project: A new game for DOS. Want to help?

Posted: Wed Feb 21, 2018 22:13
by K1n9_Duk3
KeenRush wrote: Wed Feb 21, 2018 9:02in less than 500 lines of code -- simply because I think it can be done
Err... you know that measuring anything in "lines of code" is complete BS, right? :confused

1 line of code:

Code: Select all

for (i=0; i<10; i++) printf("%d", i);
4 lines of the same code:

Code: Select all

for (i=0; i<10; i++)
{
	printf("%d", i);
}
6 lines of code that do exactly the same:

Code: Select all

i=0;
while (i<10)
{
	printf("%d", i);
	i++;
}
@keenmaster486: It's good to see that you haven't given up on this, even after your Vogons thread died.

Re: Project: A new game for DOS. Want to help?

Posted: Thu Feb 22, 2018 6:20
by KeenRush
Yes, I know. :) I meant simple lines with one statement on each, in a language like this FreeBasic.

Edit: But it's also somewhat valid measure because most people, in most mainstream languages, don't code like:

Code: Select all

while(a){ stuff(a); } while(a){ stuff(a); } while(a){ stuff(a); } while(a){ stuff(a); } while(b){ stuff(a); }
while(c){ stuff(a); } while(a){ stuff(a); } while(a){ stuff(a); } while(a){ stuff(b); } while(a){ stuff(a); }
but like

Code: Select all

while(a){
  stuff(a);
}
while(a){
  stuff(a);
}
...
Anyway, that was my more maniac mind speaking, right now I feel I will never again do anything, and all the difficulties in this idea seem so great I could never do it. :tired

Re: Project: A new game for DOS. Want to help?

Posted: Thu Feb 22, 2018 6:37
by keenmaster486
KeenRush, don't give up! I think that's a great idea. I don't think the difficulties will be too much for you.

K1n9_Duk3, thanks for the encouragement. I didn't like seeing the Vogons thread die but maybe there was just too much variety in vision there. Perhaps if we can work up a unified design document here, with the "unified vision" of a Keen-inspired game, it could work.

Re: Project: A new game for DOS. Want to help?

Posted: Thu Feb 22, 2018 10:13
by Commander Spleen
KeenRush: Taking a demoscene approach and targeting a particular executable file size limit might be a more meaningful objective. But really, just getting anything meaningful running on a 386 these days is enough of an achievement.

As for the game itself, I'd prefer the main game to be something non-Keen but Keen-inspired (but not copyright-infrigement-avoidance-pseudo-Keen). There's a lot to consider for a Keen game, including whether to incorporate mods into the fanon. Starting a new concept from scratch is less likely to create distracting arguments/criticism/cease-and-desist. (Also basically what Gridlock said earlier.)

Ideally all games running on top of it would effectively be self-contained mods, the engine simply taking the graphics, scripts, etc and acting accordingly. So a Keen 4 replica mod can be maintained as it evolves to ensure faithful replication of the physics so it can be modded into an unofficial Keen game later on.
keenmaster486 wrote:Yeah, years ago graphics in DOS was pretty much broken in FB, but it sure seems to be working now!
Yes, I agree, Jazz Jackrabbit is a good benchmark. Very fast game even with all that constant PCM MOD music going and the sheer speed of the rabbit. I messed around with it and DOSBox can go down to about 7 or 8000 cycles before it starts to stutter. The limit on my engine is currently about 25 or 30000. I've got some work to do!
Though it's hard to say how much better FB can be made to run without having to start incorporate Assembly code (though I assume some of the libraries make use of well optimised routines). A good start would be to log the time certain functions/loops take and focus on whatever major bottlenecks show up.

Are you on the PCKF Discord yet? The code is pretty well structured but it'll take some time to figure certain parts out before being able to make any improvements. It'll be much quicker if I can ask questions in real time.

A particular problem I'm seeing is screen tearing due to lack of vsync, but I don't know enough about how FB handles graphics (or exactly how this engine is handling the scrolling and redraw) in order to fix it properly yet. The core game loop could probably do with less frequent input polling to save some processor wastage. I see there is double buffering going on. Is page flipping an option so you're not blitting the entire screen a second time each loop?


Edit:

Some of the tearing may be the default open source Intel graphics driver I'm currently using. Hadn't tested with other DOS games on this new installation and there is some slight tearing in Keen 1. But, messing with the framerate and skipping every second drawing frame seems to make a notable difference. Can't seem to get the physics speed right when the framerate changes.

Re: Project: A new game for DOS. Want to help?

Posted: Sun Feb 25, 2018 3:54
by keenmaster486
Commander Spleen wrote: Thu Feb 22, 2018 10:13Ideally all games running on top of it would effectively be self-contained mods, the engine simply taking the graphics, scripts, etc and acting accordingly. So a Keen 4 replica mod can be maintained as it evolves to ensure faithful replication of the physics so it can be modded into an unofficial Keen game later on.
I like where you're going with this. That's exactly what I'm trying to do.
Commander Spleen wrote: Thu Feb 22, 2018 10:13 Though it's hard to say how much better FB can be made to run without having to start incorporate Assembly code (though I assume some of the libraries make use of well optimised routines). A good start would be to log the time certain functions/loops take and focus on whatever major bottlenecks show up.

Are you on the PCKF Discord yet? The code is pretty well structured but it'll take some time to figure certain parts out before being able to make any improvements. It'll be much quicker if I can ask questions in real time.

A particular problem I'm seeing is screen tearing due to lack of vsync, but I don't know enough about how FB handles graphics (or exactly how this engine is handling the scrolling and redraw) in order to fix it properly yet. The core game loop could probably do with less frequent input polling to save some processor wastage. I see there is double buffering going on. Is page flipping an option so you're not blitting the entire screen a second time each loop?
Over the past few days I've been going heavy on the optimization. Here's a list of what I did:

-Removed double buffering as FB gfxlib already buffers under the hood. Replaces with a pair of ScreenUnLock/ScreenLock calls which serves the same purpose. Only one VGA graphics page is needed because of this.

-Fixed screen tearing with a ScreenSync call.

-Optimized compilation with a few switches on the compiler.

-Forced usage of gfxlib's VGA driver instead of the VESA one (which it was previously using by default)

-Removed the custom PUT function I was using for transparent colors, instead modifying the palette so I can use FB's built-in transparent PUT.

-Changed various math operations to be (hopefully) more efficient.

All of this resulted in a significant speed increase. I can now put DOSBox at about 12000 cycles before it really starts to slow down. That's about twice as fast as it was before, and, according to a speed test utility I have, equivalent to a high-end 386. Now we're getting somewhere!

Here's a link to the new version:
https://drive.google.com/open?id=1K-hvU ... 1PFblxBqxQ

I also included my TED level editor (which needs to be modified sometime soon as it loads graphics from a separate file), and as a side note you can mess around with my DRO player in the IMF folder.


I am on the PCKF discord... or at least I was. I'm going to have to find where it is again and get back on!

Re: Project: A new game for DOS. Want to help?

Posted: Wed Mar 07, 2018 3:56
by keenmaster486
Lots of updates and bug fixes to the engine! New version is here:

https://drive.google.com/open?id=1qgt-K ... A0k5a8kO03

I think it's now mature enough to probably safely say that it's workable as something we can feasibly make into a final product.

Is anyone interested in starting some work on story / level design / graphics? We need story ideas first of all. I think it should be kept much more in the spirit of Keen than of other games like Doom or Duke Nukem (i.e. let's not just do the stereotypical "badass mofo" character.) Let's be creative!

One idea I have had is to make it Earth-based instead of the stereotypical alien world / space-based theme. This would give the opportunity for some beautiful Earth-inspired pixel art. The character could travel around the world and the game could showcase the best of culture and landscape and people worldwide... think "Tintin"-esque but in a video game setting. Similarly, maybe the character is always in worldwide pursuit of a Macguffin.

Just throwing things out there, any more ideas? Don't care if you think it sounds stupid cause ideas are always good!

Re: Project: A new game for DOS. Want to help?

Posted: Wed Mar 07, 2018 4:49
by troublesomekeen
Wowee! That's quite a bit of progress. Wasn't it only last week you put forth this idea? Feels like it.

Yeah, I agree. Alien world might be too obvious. I was thinking of a fairytale world with gnomes and little houses and strange plants and a castle, with all sorts of dangerous weeds, mysterious ponds and monstrously hideous cartoon characters with themes of the 'emperor has no clothes' and 'the fool up on the hill'

Image

Re: Project: A new game for DOS. Want to help?

Posted: Wed Mar 07, 2018 8:30
by nanomekia
First thing that comes to mind is something Dreams-esque. Perhaps (if this is Keen itself!) Keen, the little genius, has made a device that can transport him into his favorite book/comic/TV show, and his adventure is in there?

If not, can still adapt that to whoever our main character will be~

Re: Project: A new game for DOS. Want to help?

Posted: Wed Mar 07, 2018 9:32
by Commander Spleen
keenmaster486 wrote: Is anyone interested in starting some work on story / level design / graphics? We need story ideas first of all. I think it should be kept much more in the spirit of Keen than of other games like Doom or Duke Nukem (i.e. let's not just do the stereotypical "badass mofo" character.) Let's be creative!

One idea I have had is to make it Earth-based instead of the stereotypical alien world / space-based theme. This would give the opportunity for some beautiful Earth-inspired pixel art. The character could travel around the world and the game could showcase the best of culture and landscape and people worldwide... think "Tintin"-esque but in a video game setting. Similarly, maybe the character is always in worldwide pursuit of a Macguffin.

Just throwing things out there, any more ideas? Don't care if you think it sounds stupid cause ideas are always good!
I'd be more interested in something like that taking place on another planet without Earth being involved at all. Something that involves inventing a variety of cultures instead of the globally established civilisations that tend to occur in Keen and similar games.

Re: Project: A new game for DOS. Want to help?

Posted: Wed Mar 07, 2018 23:09
by keenmaster486
Good ideas everyone! Maybe we can put them all in this document?

https://docs.google.com/document/d/15Dp ... sp=sharing

Re: Project: A new game for DOS. Want to help?

Posted: Thu Mar 08, 2018 0:53
by nanomekia
I'll flesh out this idea a bit more and toss it in there, sure. I think a lot could be done with it. :D

Re: Project: A new game for DOS. Want to help?

Posted: Tue Apr 24, 2018 19:43
by keenmaster486
I think it's time to work on some Earth-based pixel art. This game should be a tribute to 20th and 21st century pop culture and retro video games in general.

Re: Project: A new game for DOS. Want to help?

Posted: Wed Jan 23, 2019 22:18
by keenmaster486
I'm trying to get this project started up again. I've done some more work on the engine to make it faster and more stable. Seems to be about as fast as Jazz Jackrabbit now if DOSBox cycles are a consistent measure.

As far as the storyline and characters/setting, I'm thinking the following:
  • Set in a period time on Earth, perhaps 1930's or 1990's or something.
  • Storyline would be a classic adventure thing, with an evil villain wanting to take over the world and the hero having to fight off his minions before the final boss.
  • Main character should have elements of favorite pop culture icons such as Indiana Jones, Commander Keen, and Tintin, to fit with the adventure theme.
  • Story and gameplay should have many references to pop culture and science fiction.
  • "Look and feel" of the game: at times cinematic, at times science fictiony, but always engaging and beautiful. It has to be pretty. Locations could include the best places on planet Earth, with great 256 color scenery.
I think my vision for the thing is as a sort of a homage to good old DOS games and 20th century pop culture.

Re: Project: A new game for DOS. Want to help?

Posted: Sun Jan 27, 2019 17:33
by keenmaster486
Anyone want to help me out with this thing by helping me write the sound effects code?

I’m having trouble figuring out how to send data to the Sound Blaster for digital sound effects. There are a lot of QB-compatible programs out there that do it, but I can’t use them in FB due to there being some QB-style assembly calls and some VARSEG/VARPTRs.