Space99 - Development Forum

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Dbug
Site Admin
Posts: 4462
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Chema wrote:I used QWAS before, but changed to the current system and implemented it in WHITE (white_step and white_turn functions) because I allways preferred what they called directional control in Ultimate's games. If we have enough memory (which I doubt) we can include both options and let the player decide.
It's what I did in my 4k game Cyclotron, because if personaly I like the 'relative' mode (turn left/right/move forward/move backward), most people prefer the 'absolute' mode (go west, go north, go east, go south).

Now, since you are discussing memory, I guess I can probably help on this point. If you are using some kind of version control software, or at least if you can do 'diff' between files and inserts the changes, I could do size and speed optimisation in your code.

For that, just send me the last version, I have some ideas I can probably test this week end :)

Some will probably involve replacing some C routines by some assembly code and few tables here and there :)

Interested ?
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Dbug wrote:
Now, since you are discussing memory, I guess I can probably help on this point. If you are using some kind of version control software, or at least if you can do 'diff' between files and inserts the changes, I could do size and speed optimisation in your code.

For that, just send me the last version, I have some ideas I can probably test this week end :)

Some will probably involve replacing some C routines by some assembly code and few tables here and there :)

Interested ?
Indeed!! Welcome abroad Dbug... :)

So you will look into the code, eh? At your own risk! It is not necessary that you optimize the C routines, as they are just for checking and will probably change in the end. It is just that I find C easy for testing and also check if WHITE+NOISE are usable within that languaje. Sources are here:
http://www.defence-force.org/ftp/forum/ ... isev04.zip

You will see two directories: WHITE and NOISE with copies of the sources, however as NOISE is huge, there is a .bat file (buildnoise.bat) which merges them all in a single file called noise.s.

When running osdk_build.bat those sources are copied into the main directory. You can make changes in the subdirs freely, but in NOISE, remember to change the individual files and build it again before anything else.

I am not using any system for version control, so please let me know the changes you make, so I have a clue... Also as I am leaving for a week, I might not work on this project in a while, so if you make any progress I can directly overwrite my files when I am back :)

Also bear in mind that some code (mainly in NOISE) is very old and I had even less experience in 6502 programming (was just experimenting, and with another much less good-looking asm) so it is really a mess. And I still have to do some cleaning...

I once told you that rotations were only made in multiples of two? I was wrong... sort of. You cannot use this for optimizing as rotations can be 0,2,4, but also 1,3,5. This is because the sprite gfx should be exactly positioned for good collision detection, independantly of its size :(

If you tell me your plans we can comment on them... Or maybe you prefer to surprise me!

Thanks and cheers.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Late last night i finished a revised map.

This fixes the border door issue by splitting the door into door and doorjamb ;) as previously discussed.
If this new height mean a reduction in character height, then that is fine, i can cope with that.

I have also reintegrated the curved walls you liked so much Chema. I haven't done the complete map yet but only a few rooms in the top left of the map. Please let me know what you think.

See link above for white.zip.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:Late last night i finished a revised map.

This fixes the border door issue by splitting the door into door and doorjamb ;) as previously discussed.
If this new height mean a reduction in character height, then that is fine, i can cope with that.

I have also reintegrated the curved walls you liked so much Chema. I haven't done the complete map yet but only a few rooms in the top left of the map. Please let me know what you think.

See link above for white.zip.
Have just seen it... and I like it a lot. I think the curved walls add a much more space1999-ish atmosphere, seriously. However I am not sure if having their counterparts in "inset" tiles is necessary (thinking on saving space) but maybe it won't work visually...

And with doors... as long as those new tiles are put at layer 3 (as I think they are) there should be no problem.

Have any ideas about the inverted walls being in the "wrong" side? Anything that can be done with some kind of graph trick and avoid me a headache?
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Have just seen it... and I like it a lot. I think the curved walls add a much more space1999-ish atmosphere, seriously. However I am not sure if having their counterparts in "inset" tiles is necessary (thinking on saving space) but maybe it won't work visually...
Yes, i understand the space saving idea, especially since we are fast running into memory problems. I suspect you are thinking we should release this Space:1999 without Dbug optimisation and to me that sounds quite a good idea. Not because Dbug would not make improvements but because the first game can potentially be a proof of concept. I also think all the stuff you have achieved over the last year with this project must be paying its price by now in exhaustion?
And with doors... as long as those new tiles are put at layer 3 (as I think they are) there should be no problem.
Yes all are.
Have any ideas about the inverted walls being in the "wrong" side? Anything that can be done with some kind of graph trick and avoid me a headache?
I'm glad you mention this, because the curved cut-out walls at the front occupy the "right side" so that they will look right when the player moves up to them.
I think this can also be done for some other cut-outs. Infact i may have got the design a bit wrong... i am thinking... Border walls should be possible to place so that it avoids this issue.
However internal walls are more tricky, i shall try to design some that are better placed toward the centre lines of each tile.

Anyway, i hope it all goes well for you in Boston, is it for Business or Pleasure?
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote: Yes, i understand the space saving idea, especially since we are fast running into memory problems. I suspect you are thinking we should release this Space:1999 without Dbug optimisation and to me that sounds quite a good idea. Not because Dbug would not make improvements but because the first game can potentially be a proof of concept. I also think all the stuff you have achieved over the last year with this project must be paying its price by now in exhaustion?
Exhaustion? Well, nearly :) but I have patience... As there is so much to be done yet (we don't have inventories, nor plot, nor sound, nor a game itself) we may have time to include that improvement. On the other hand, indeed its most a proof of concept: really it is a test to see if WHITE+NOISE layers conform a usable engine.

About this, Dbug, I did not remember to tell you that one place where optimization in speed can be important is in the drawing of rooms (check routine _draw_room in iso_funcs.s) which implements the algorithm I posted some weeks ago. It loops through tiles performing the stacked drawing and updating screen coordinates. When in double buffer mode, put_sprite and put_sprite2 check if the graphic intersects with the area to be redrawn, so the only overhead is the loop itself.

I also have an array with bitflags (8 per tile) that indicate if there are blocks or characters to be drawn, so the checks are quicker. In theory, you should check all the tiles, but with the restriction of having graphics of 4 scans maximum, you noly have to check a strip (if we had also a limit for height, more restrictions could be applied, but I think it might be not worth it):

Code: Select all

 
    ; We are in double buffer mode, so:
    ; tile is (iloop2,tiley) for (i,j)
    ; let's see if we need to draw them
    lda tiley
    sec
    sbc iloop2 ; calculate (j-i) and compare with original
    sbc tilex
    bpl cc_notneg
    sta tmp
    lda #0
    sec
    sbc tmp
cc_notneg
    cmp #5		;; WARNING: WITH 4 THERE ARE SOME CASES IT DOES NOT WORK!
    bcs dr_no_paint
Notice that tilex has an old name that does not really represent its content, it keeps the difference (j-i) for the tile we are updating the screen around (normally the character location)... this happens often in these old loops, so be careful (sorry for such nightmarish code :oops: I planned to clean it up before releasing...).

I suppose all this could be changed so it only loops for the tiles we already know that should be drawn, reducing greately loop overhead (which is quite large). But as the loop also updates screen coordinates, a function that translates (i,j) tile coordinates to (x,y) screen coordinates is needed. I have one (ij2xy) but it is not quick enough. Maybe a table can help here? Maybe with some trick to avoid having two 100-byte arrays?
Have any ideas about the inverted walls being in the "wrong" side? Anything that can be done with some kind of graph trick and avoid me a headache?
I'm glad you mention this, because the curved cut-out walls at the front occupy the "right side" so that they will look right when the player moves up to them.
I think this can also be done for some other cut-outs. Infact i may have got the design a bit wrong... i am thinking... Border walls should be possible to place so that it avoids this issue.
However internal walls are more tricky, i shall try to design some that are better placed toward the centre lines of each tile.
Good... That is what I meant. Let's see if that solves some problems. The real matter here is that thick walls that occupy one tile (almost) do not look good for Space 1999... It would do for a dungeon or a castle...
Anyway, i hope it all goes well for you in Boston, is it for Business or Pleasure?
Thanks. Bussines... I will attend a conference (Optics East) with matters related to our work at the university, but I will find some time for sightseeing :lol:
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Back!

Post by Chema »

Greetings...

I am back from my trip... need some time to set everything up, though...

Any news or progresses?

Cheers
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

I am back from my trip... need some time to set everything up, though...
Any news or progresses?
haha, oops :(, got a bit lazy with your absence, so not done much.
I have worked out how to improve the walls, but it would involve a big change to graphics.

Each wall segment would be an object rather than a flat, therefore consuming the complete tile. This wouldn't look so bad in space1999, especially if it was a "double partition" rather than a solid wall. The problem is the additional memory.

The other idea is more dramatic, where a further flag would select which side to base a flats position on.
For example, if this flag is reset...

Image

and if set

Image

And this flag would be selectable within White Editor.
This would not cure the problem of internal walls, but i think i can reposition in the form of objects rather than flats to sort that issue.
User avatar
Dbug
Site Admin
Posts: 4462
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Back!

Post by Dbug »

Chema wrote:I am back from my trip... need some time to set everything up, though...
Any news or progresses?
I took a lookt at the code, I will need more time to actually do something significatively better.

One of the thing I found out anyway, is that you have .word tables. It's not a very good idea in general to do that. Way more efficient to split the data with HIGH and LOW bytes in two separate 8 bits entries.

Typically this would makes it possible to have your offsets on scanlines fit entirely (because right now you have only half of them and you have to add 40 if the line is at an odd coordinate). Resulting in less shifts and intermediate calculations :)

Also I'm not really sure about what the "double_buff" flag is about; looks like you do very different things based on it's value. And also the comment of routine "pixel_adress" is missleading, becaus obviously the code handles some sort of clipping... but I'm not exactly sure of how it work :)
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote: haha, oops :(, got a bit lazy with your absence, so not done much.
I have worked out how to improve the walls, but it would involve a big change to graphics.

Each wall segment would be an object rather than a flat, therefore consuming the complete tile. This wouldn't look so bad in space1999, especially if it was a "double partition" rather than a solid wall. The problem is the additional memory.

The other idea is more dramatic, where a further flag would select which side to base a flats position on.

And this flag would be selectable within White Editor.
This would not cure the problem of internal walls, but i think i can reposition in the form of objects rather than flats to sort that issue.
I had the same idea (the flag) some time ago, but it will reduce your maximum tiles to 32... don't think you want that. Anyway, as the problem is with south and east walls and allways inset flats are used there (walls are not visible) maybe these gfx can be drawn in the "correct" position. This won't solve the problem with inner walls either.

In addition doors won't fit well in this case, but either we can have a different tile with the door in the "correct" place for south and east walls or you can put some decoration in the adjacent tiles (similar to the current one, but that looks good with the door in the opposite tile border). No problem with doors in this case, as the character will move perfectly over the tile when trespassing the door (when I program it :) ).

On using full-tile size walls... I know the problem of size. Maybe we can use that for inner walls, and flats for outer doors? I have no ideas here.... either use less graphics or use overlay ram... Space 1999 will be quite graphic intensive, when comparing to the first ISO games in the 80's... and I will need some memory for what I have in mind for interactions... :twisted:
Dbug wrote:I took a lookt at the code, I will need more time to actually do something significatively better.

One of the thing I found out anyway, is that you have .word tables. It's not a very good idea in general to do that. Way more efficient to split the data with HIGH and LOW bytes in two separate 8 bits entries.

Typically this would makes it possible to have your offsets on scanlines fit entirely (because right now you have only half of them and you have to add 40 if the line is at an odd coordinate). Resulting in less shifts and intermediate calculations :)

Also I'm not really sure about what the "double_buff" flag is about; looks like you do very different things based on it's value. And also the comment of routine "pixel_adress" is missleading, becaus obviously the code handles some sort of clipping... but I'm not exactly sure of how it work :)
Well... :oops: I already told you the old code is a nightmare... it is full of kludges and patches and often not well documented... I know I should have done that, but...

About the word tables, I agree. As you noticed I discovered the trick and moved onto HIGH/LOW byte tables. However in this case, it is not the reason. This routine is original of a friend of mine and was an excellent compromise between speed and size as the quite intelligent algorithm saves *half* the table sizes (200 + 240 bytes in tab_scan and tab_mod06!).

On the double_buff flag... it handles when drawing is done in an off-screen memory area (scr_buffer) which will be then dumped onto screen at a rectangle set by the clip_rgn structure (see noise.h). Several routines use this flag to operate differently when in either mode. The set_doublebuff function changes this flag and... some code :oops: to make everything work. Therefore pixel_address behaves differently when requesting the address of a pixel in normal mode (screen address) or in double buffer (scr_buffer address).

As when in double buffer mode, the address requested can be outside the clipping_region (e.g. a sprite which only the right half is to be redrawn), this must be handled: pixel_address will return a pointer to a memory area *outside* the buffer (so probably over useful data), but the drawing doutines will never draw anything outside the clipping rectangle, so it is safe... hopefully.

Anyway I think this routine is not eating up CPU cycles... the most important routines are all the put_sprite versions (one for sprites that shall be rotated, one for those that do not need it, and another two for dealing with masks to avoid bad rendering in some cases) and the draw_room loop (have you read my post about this just before I left to Boston?).

Sorry again for the confusing code... I warned you I had to do some cleaning before releasing anything ! :)

Regards,
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Hasn't this been too silent lately? No news?

Well, in fact I am very busy at work now, so I did not work on WHITE. Anyway I have some ideas in mind and I will try to test some of them as soon as it is possible.

Dbug, I hope you have not got despair with the code... :oops:

Cheers
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Chema, i have been ill for past couple of weeks, however i did go off to Holland last weekend as planned. I managed to figure out some better designs for wall borders and will work on them now :)

This is what i have so far...
The first screen illustrates the outside wall idea, whereby all cut-out walls lye on the farthest edge of the tile, so Helena can move right up to it.

Image

The second example illustrates the inside wall. Note that it is placed in the centre of the tile. Also note to save tiles i have used a centre column cut-out, i hope this is sufficient?

Image

I now have alot of editing of the rooms to do :P
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:Chema, i have been ill for past couple of weeks, however i did go off to Holland last weekend as planned. I managed to figure out some better designs for wall borders and will work on them now :)

This is what i have so far...

<ZAP>

I now have alot of editing of the rooms to do :P
I like them a lot! Congrats!

As soon as you send me the map file, I will try to have a small demo where you can walk around alpha...

I have to code the thing about doors yet... but, as I said, I am currently very busy at work.

Cheers.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Ok, i have re-edited all the rooms and they can be found here...

http://www.defence-force.org/ftp/forum/ ... /white.rar

I have also made a note of lift rooms...
Main mission Lift - 67
Hydroponics Level Lift - 48
Research Level Lift - 54
Accomodation Level Lift - 76

Launch Pad 5 Foyer - 177
Launch Pad 3 Foyer - 156
I will now try to improve on the graphics, by matching them with furniture and surfaces found in Alpha.
I will also continue to design further alpha levels, populating the top two rows so that we end up with a solid block at the top of the total map which i believe is what is better?
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:Ok, i have re-edited all the rooms and they can be found here...

http://www.defence-force.org/ftp/forum/ ... /white.rar

I have also made a note of lift rooms...
Main mission Lift - 67
Hydroponics Level Lift - 48
Research Level Lift - 54
Accomodation Level Lift - 76

Launch Pad 5 Foyer - 177
Launch Pad 3 Foyer - 156
I will now try to improve on the graphics, by matching them with furniture and surfaces found in Alpha.
I will also continue to design further alpha levels, populating the top two rows so that we end up with a solid block at the top of the total map which i believe is what is better?
Will have a look inmediately.

In fact it if the map is a solid block or not is not important, due to the way rooms are stored in memory (in no particular order, with no empty spaces or additional data when a room is not used). However having rooms organized a bit is a good thing, so we have some emtpy space... I had something in mind... which I am not sure if could be included, however.

Regards,
Post Reply