Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Galactic Conquest v9 beta 55 - additional feedback (Announce)

posted by Arjay, 19.05.2010, 17:27

Firstly thank you for taking my feedback on board.

> > - Game - Data entry fields filter needs to be better, e.g. non valid
> > characters CTRL ^A or CTRL ^C are shown
>
> That I hadn't noticed before, I'll check into that.
I spotted you are using TP's built in Readkey (well drop in replacement). Readkey sucks for key filtering to be honest. The following snippet from a longer routine within one of my own TP (circ. 1995) games is NOT perfect but should give you an example of a game keyboard handler without using Readkey:

{****************************************************************************}

Function Keyboard_Handler:Byte;

Var
    TempByte:Byte;

Begin
Asm
@readk:
    mov ah, 1
    Int 16h
    jnz @gotone
    jmp @not_us

@gotone:
    mov TempByte, 1
    xor ax,ax
    int 16h
    cmp al, 27 {ESCape}
    je @quit
@chkcursors:
    cmp al, 0  {extended character?}
    jne @not_us
@chkdwn:
    cmp ah, 50h  {down}
    jne @chkup
@down:
    mov direction, 4
    jmp @done
@chkup:  {Doctor, I don't feel very well :)}
    cmp ah, 48h  {up}
    jne @chklft
@up:
    mov direction, 1
    jmp @done
@chklft:
    cmp ah, 4bh  {left}
    jne @chkrht
@left:
    mov direction, 2
    jmp @done
@chkrht:
    cmp ah, 4dh  {right}
    jne @chkF1
@right:
    mov direction, 3
    jmp @done

@quit:
    mov TempByte, 5
    jmp @done
@not_us:
    mov TempByte, 0

@done:
End;
  KeyBoard_Handler:=TempByte;
End;

{****************************************************************************}


Basically in brief: the above code returns either a direction 1-4 (e.g. cursor up is 1, cursor left is 2, cursor right is 3, cursor down is 4) or if ESCape is press 5 is returned to quit. The routine "could" be used like this:


Terminating:=FALSE;
Repeat
  Case Keyboard_Hander of
     1: move_left;
     2: move_up;
     3: move_right;
     4: move_down;
     5: Terminating:=TRUE;
     else {ignore should not get here anyway};
   End; {of case, Dr Watson!}
  KillSomeTime;
Until Terminating;


Note: Feel free to modify reuse the above code and GPL the resulting code.


> I'm going to try to figure out how to hook Alt-Q into bringing up that
> procedure (similar to how I have CTRL-BREAK locked out).
To be honest I would recommend you quit with ESCape as you will find this easier to implement than Alt-Q. Yes, easier to press but knowing what is involved with doing a Alt-Q handler I think you are best off doing the later.

Moving onto your CTRL-Break handler be aware that when you call TP halt routine via the halt commands in your "debug" code and in the "data" and "font" loaders that you are currently *NOT* restoring the control break Interrupt.

The best thing to do is have a standard single clean exit routine which you call instead of halt. This exit routine would then be called within the main program and in these error situations as well to ensure the control break interrupt was restored in all cases and would in turn call halt if needed.

Basically I suggest changing your main code to look something like this:


Begin
  Initialize;
  RunGame;
  Terminate(0);
End.



Where initialize has your existing initialization code (currently in the main program body) and terminate has the opposite code. Note: I'm suggesting this at a high level rather than saying this is exactly how to do it. But it makes it easier to do things like Terminate(5); instead of Halt(5) where NOT only does Terminate(5) call halt(5) but it does some clean ups before it does.

I would also strongly suggest keeping your init and terminate routines simple rather than trying to be too clever for now with ExitProc/ExitCode/ExitAddr.

I suggest this as when you use the Halt command within a TP program Borland's own Runtime library "exit" routines still get called under normal circumstances. Including I might add when there is a "runtime error". Think of Borland's own exit routines as hidden procedures you don't get to see.

If you implement an ExitProc handler incorrectly then Borland runtime library exit routines may NOT get called which is very bad since the Borland runtime library (in the case of TP7) "redirects" 19 interrupts to its own code.....


> > - Game - Method for entry the length of time entry could be more
> > friendlier
> Originally it was 3 prompts (one each for hours, mins, secs). Any
> recommendations on this?
To be honest "no". I wrote down some raw thoughts as they occurred to me. In many ways what you have got is probably sufficient. I'd focus elsewhere.

> > - GC.TXT
> Will update.
thanks

> > - GALCON.EXE - A file compressor will give over 50% (at least) size
> > reduction
> Why would this be necessary?
This isn't but IMHO looks better. Importantly it also means your game will be smaller for people to share around the world where bandwidth, diskspace aren't always as readily available as they are in the western world.


> > - CRT70 files - remove or at least include the *full* distribution
> > version
> The CRT70 files were only included for testing purposes, I wasn't planning
> on including them with the game.
Ok.

> As for the version, I thought they were the full distribution,
> what makes you think they are not?
Because I previously downloaded the full version when I was working to help you work out which replacement CRT library you had used by studying the actual runtime code. So I know these files are included within the full version but on their own are NOT the full version which has more files. It would be a bit like me just including GALCON.EXE without anything else (such as your documentation, other files) in another totally unrelated distribution.

> > - GCDEBUG.LOG
> This will be deactivated once it goes gold, it is for debugging purposes
> only.
Ok! I kind of guessed its function ;-)


> > - GCDOSBOX.conf - I seem to remember somebody suggested removing this
> >(I agree)
> I'm leaving it in as an example for how to use it with DosBox.
Ok.

> I'll look into error handling for missing files.
Thanks. Refer back to my comments re a using a standard Terminate routine.

> I won't be including FONTEDIT.COM, but I will be including INTVFONT.COM
> (or renaming it), as the game requires it to work properly. FONTEDIT.COM
> isn't required.
Ok. TP/DOS's exec function should allow you to execute anything you like, e.g. GALACTIC.DAT which could be a renamed EXE file. This possible since the DOS kernel simply checks the top of the file for MZ to determine if an EXE file or NOT, else it simply assumes that it is a .COM file. It is COMMAND.COM etc which "associates" .COM + .EXE extensions as being executable.
So in short you can update "loadfont" in GCUNIT to use whatever name you like.


> Let me know if you think of anything else.
To be honest your general copyright/GPL statements. The reason I call this all out is I have coded with TP since 1989 hence I am familiar with many of the TP code examples out there as I've referred to many myself in the past.

Code has a signature, some of that signature can be very subtle. For example I know your LeadingZero is the exact example from the TP help files. How do I know? Not just because of the well known name but also the exact case used, the use of the S variable name, the spacing between ":=" and "S" etc.

So even though you've put a comment above to explain what it does, I can still see where that code originally came from as I that familiar with it.

Likewise IntToStr, SaveXY, LoadXY - TP help file examples etc. Don't get me wrong I'm not saying using these examples is bad. But when it is obvious to the trained eye that you didn't for example write BRIGHTBGON or BRIGHTBGOFF - it doesn't look to good if your just slapping copyright and the GPL on them.

How do I know you didn't write the later? Well again because of their code signatures which are also in a very different style to the rest of your code.

So what I would suggest doing is if you remember you didn't write something move it off into a separate unit but please don't stick GPL onto non-GPL code as you are likely to annoy a lot of people who wrote that code originally.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (2 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum