[V9990] Q&A Official Thread

Pagina 6/19
1 | 2 | 3 | 4 | 5 | | 7 | 8 | 9 | 10 | 11

Van Manuel

Ascended (18254)

afbeelding van Manuel

03-03-2016, 21:31

AxelStone wrote:
MrSpock wrote:
Kai Magazine wrote:

I do not quite understand what you mean, and probably you did not understand me either, because it is not a nightmare at all, as a matter of fact it is quite simple.

I think that what Manuel is saying is that if you detect a bug in the common code for all stage*.bas, then you have to correct all the stage*.bas and test them all again. That's the "nightmare" of code duplication.

In BASIC you run out of memory too soon, so you have 2 options:
1) Make your game simpler.
2) Make several engines with some variations (different enemies, objects, etc)

You decide what do you prefer Smile

3) make your program smarter. Use a single engine, which is data driven. The data is the only thing that differs between stages. No duplication (with all its disadvantages) and you have exactly the right flexibility. It takes proper software design, though Smile

Van tvalenca

Paladin (747)

afbeelding van tvalenca

03-03-2016, 21:48

Manuel wrote:

3) make your program smarter. Use a single engine, which is data driven. The data is the only thing that differs between stages. No duplication (with all its disadvantages) and you have exactly the right flexibility. It takes proper software design, though Smile

Bravo! no matter what programming language you use, it's always smarter (and better designing) to not replicate code.

Note that this don't necessarialy implicate on an IF-THEN-ELSE nest to handle different stages. using smart coding any routine from clipping to NPC animation could be handled by a single program. (The challenge is to make all the code fit on BASIC's free user memory)

Van Kai Magazine

Paragon (1417)

afbeelding van Kai Magazine

03-03-2016, 22:05

Nice words Manuel, but the fact is:
It is impossible to include ALL the features of "no name"'s whole game (each boss, each different engine to show triple parallax effect or labernthyc stages in which you have to find keys and open doors, the train stage, the bridge stage... All on a 7,5k basic routine... No matter how smart you are, it is absolutelly impossible.
Just try it!

Or "nuts" for example: no matter how smart you get you will not manage to fit the game physics "climbing/falling" with the "pick up a box or a knife" or the final battle in which KAI uses a gun...
Easy to say, impossible to do in 7,5 k.

Life on Mars has even less free avalable memory due to the moonsound music + sampled sound effects ASM routines, so I only had 6,5 k.
On 6,5 K I barely made it fit a main engine, and I had to leave some known bugs unsolved in order to avoid cutting features.
No matter how smart you plan it you will NOT get to include 9 different kinds of Artificial inteligences + the elevator area (which is another modified engine) + the initial area showing the 2 parallax scrolls (which is another modified main engine).
I did quite a few games/demos/projects/failed engines on turbo basic. I can assure you that I got quite smart on it.
As a matter of fact, I know many developers who attempted to create a Turbo Basic game engine and they gave up because of the infamous "out of memory" and they attempted things I already did, so...

Just try to do a game with ALL the features I mention in just one Turbo Basic engine, and then we can talk...

Van Manuel

Ascended (18254)

afbeelding van Manuel

03-03-2016, 22:18

For bosses, it could be logical to load another engine, as it's a completely different kind of game. At least in games like Shrines of Enigma, for instance. I'm just saying you should avoid code duplication Smile

How exactly does code duplication solve out of memory issues?

Van Kai Magazine

Paragon (1417)

afbeelding van Kai Magazine

03-03-2016, 22:27

People get the OUT of memory message when they want to put too many things in the same turbo basic block (like to put the whole game in it).
To have several engines allows you to do all the things you planned for your game and do not get an "out of memory".

Van Manuel

Ascended (18254)

afbeelding van Manuel

03-03-2016, 22:34

I'm not against several engines, but I say they should be different enough to avoid code duplication. If they're not, better make the variation end up in the data the engine is using. (Note that data can also be stored outside your turbo basic block.)

Van zPasi

Champion (499)

afbeelding van zPasi

03-03-2016, 22:37

Manuel wrote:

For bosses, it could be logical to load another engine, as it's a completely different kind of game. At least in games like Shrines of Enigma, for instance. I'm just saying you should avoid code duplication Smile

How exactly does code duplication solve out of memory issues?

I think he loads different basic programs for different levels (or stages or whatever). Then, the main player routine and some other things must be duplicated on these basic programs.

Just guessing...

Kai Magazine wrote:

Nice words Manuel, but the fact is:
It is impossible to include ALL the features of "no name"'s whole game (each boss, each different engine to show triple parallax effect or labernthyc stages in which you have to find keys and open doors, the train stage, the bridge stage... All on a 7,5k basic routine... No matter how smart you are, it is absolutelly impossible.

Why just 7,5K? You mean, after Turbo / Kun basic has eaten it's share, 7.5K is what's left?

The cartridge version of Kun basic (like it originally was?) doesn't eat that much. And you're distributing your games on cartridges. But they are actually disk images converted to roms, right? That's why you can't use cartridge version of Kun basic? I think it should be possible to do that otherwise. It requires some assembly code, but maybe someone could do that for you, so you could continue with the Basic code.

Just thinking...

Van tvalenca

Paladin (747)

afbeelding van tvalenca

03-03-2016, 23:12

zPasi wrote:
Kai Magazine wrote:

Nice words Manuel, but the fact is:
It is impossible to include ALL the features of "no name"'s whole game (each boss, each different engine to show triple parallax effect or labernthyc stages in which you have to find keys and open doors, the train stage, the bridge stage... All on a 7,5k basic routine... No matter how smart you are, it is absolutelly impossible.

Why just 7,5K? You mean, after Turbo / Kun basic has eaten it's share, 7.5K is what's left?

The cartridge version of Kun basic (like it originally was?) doesn't eat that much. And you're distributing your games on cartridges. But they are actually disk images converted to roms, right? That's why you can't use cartridge version of Kun basic? I think it should be possible to do that otherwise. It requires some assembly code, but maybe someone could do that for you, so you could continue with the Basic code.

Just thinking...

Thats a great point! So, I fired up OpenMSX and loaded a machine known for having XBASIC ROM: Sanyo PHC-70FD (MSX2+)
and typed "_BC", then "?FRE(0)". I got the same 23414 of the "23414 bytes free" message from MSX-BASIC boot. Can I assume that cartridge XBASIC/BASIC KUN does't consume memory?

Anyway, @Kai makes games in Turbo Basic for everyone, not only those who has Sanyo MSX2+ or Basic Kun Cartridge...

Van zPasi

Champion (499)

afbeelding van zPasi

03-03-2016, 23:25

tvalenca wrote:

Anyway, @Kai makes games in Turbo Basic for everyone, not only those who has Sanyo MSX2+ or Basic Kun Cartridge...

Of course. I meant, maybe someone could hack the Kun Basic cartridge version and Kai's stuff into a same cartridge. There would be some clever routine there, that autostarts the whole show, loads Basic stuff in RAM, then activates Kun Basic in and starts the Basic code.

Van Grauw

Ascended (10175)

afbeelding van Grauw

03-03-2016, 23:29

As far as I understand, the .BIN-versions of Basic-kun also don’t consume Basic memory (they run in the unused lower 32K RAM), so there you also have 23K free.

However, Basic-kun compiles the turbo blocks to assembly code in the same 23K as the Basic-program. So that 7.5K limit means that it generates 15.5K assembly code, and if the Basic program would grow any bigger than 7.5K it won’t have enough memory anymore to compile the turbo block.

Correct me if I’m wrong, but that is my understanding.

Pagina 6/19
1 | 2 | 3 | 4 | 5 | | 7 | 8 | 9 | 10 | 11