Chaosforge Forum

  • June 30, 2022, 19:59
  • Welcome, Guest
Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Igor Savin

Pages: [1]
FPC Valkyrie / Colouring TTextModeMessages?..
« on: August 13, 2009, 14:01 »
Kornel, I'm completely lost. I need to colour entire Message in colour other than LightGray, but there doesn't seem to be any procedure or variable related to that!.. The closest thing is LoadColors, which is supposed to read colourcoding from file, but it's so enigmatic, I couldn't make heads or tails of it.

Is there a simple way to accomplish the colouring?..

FPC Valkyrie / Realtime input in Valkyrie
« on: May 17, 2009, 06:56 »
Kornel, what is the Valkyrie way of

Code: [Select]
if KeyPressed then Readkey

FPC Valkyrie / What should never be
« on: May 03, 2009, 04:00 »
Since I'm the only candidate for Valkyrie maintenance at the moment, probably now is the appropriate time for articulating my personal vision of the Valkyrie development, which should probable be enough for any sane person to permanently forbid me coming closer than 50 feet to any computer with FPC installed to it.

Let's take a shot at it.

First of all, I must confess, there's lots of magic inside Valkyrie for me; I have clearly no idea how many parts of it work or how I could use them for my benefit. It's totally a nuclear-bomb-for-president: infinitely powerful black-box.

Thus I would break my aggressive overtake plan into four phases.

1) Part-by-part disassembling (as in "tinkering") with trying to think of one hypothetical case where one particular procedure might be used, trying it and documenting an example should I succeed. That would both serve my own understanding on what kind of a realm I'm trying to control, and increasing the amount of documentation we have at hand.

2) After I can boast at least 45% understanding of Valkyrie feature-set, time for refactoring comes. I am structure Nazi and most probably will have to reshape certain things to simplify further development.

3) Third phase is finally useful for the community: The Great Merge. Valkyrie will be enriched by set of my Golem libraries, which will mean you are getting powerful and easily customizeable Save\Load, Inventory, Item, Skill, Global Map, Creature (and so on) infrastructure for free.

4) Final phase: mature development! Here we are fixing bugs, improving performance and thinking of new features.

Now closer to my global vision of Valkyrie. Kornel did a wonderful job at laying the groundwork for FreePascal-based game development and I don't think there is need for any additional fundamental features. I see my task as improving inner structure of existing shrine (thus simplifing use and decreasing learning time needed) and adding more game development ready-made tools - things like currently existing LOS code. Thus sometime later a poll will most likely be held to estimate, what additional modules would be of the greatest use for fellow FPC developers.

FPC Valkyrie / Weird stuff in Valkyrie
« on: January 24, 2008, 14:15 »
procedure TTextModeOutput.DrawChar(x,y : byte; atr : byte; chr : char; Color : TColor = 0);
  VideoBuf^[(x-1)+(y-1)*ScreenSizeX] := Ord(chr)+(atr shl 8);


What is the "Color" here for?


Also, maybe you should update

type TINIFileCallbackProcedure = procedure (const nkey,nvalue : string);


function InputCommandParser(const Token : String) : byte;

TTokenReader = function(const Token : string) : byte;

type TINIEntry = record
                   a : ShortString;

to use ShortStrings, in order to avoid error messages like

E:\Elwin\Yhacking\Pascal\Valk\vui.pas(836,47) Error: Incompatible type for arg no. 1: Got "<address of procedure(const ShortString,const ShortString);Register>", expected "<procedure variable type of procedure(const AnsiString,const AnsiString);Register>"

FPC Valkyrie / Suggested "vnode" expansion
« on: January 12, 2008, 08:23 »
I've been using modified vnode for a while; in order to preserve compatibility with ever-changing Valkyrie I'm asking for the following changes:

3 new functions, 1 new procedure and one tweak.


Code: [Select]
       function LastChild : TNode; {OK, I know there is Child.prev, but I prefer writing code in plain English}
       function ReturnExactChild (const Position : Word) : TNode;
       function ReturnRandomChild : TNode; //uses ChildCount variable which is described later
       procedure DestroyAllChild; //destroy all children but keep parent intact


Code: [Select]
function TNode.LastChild : TNode;
if hasChild then exit (Child.prev) else exit (nil);


Code: [Select]
function TNode.ReturnExactChild (const Position : Word) : TNode;

var i : Byte;
      RC : TNode;



if Position>1 then for i:=1 to Position-1 do RC:=RC.Next;

exit (RC);


Code: [Select]
function TNode.ReturnRandomChild : TNode;

if hasChild then Exit (ReturnExactChild (Random(ChildCount)+1))
else Exit (nil);



Code: [Select]
procedure TNode.DestroyAllChildren;
while Child <> nil do Child.Destroy;

TNode tweak:

additional field
       ChildCount : Word; {How many Children this Node has; I use it very often}


+ChildCount := 0; //in the end of constructor


+inc (ChildCount); //in the end of procedure

  if Parent <> nil then begin //in the beginning
    dec (Parent.ChildCount);

p. s. If you accept any of the mentioned changes, I can supply modified "vnode.pas", although modification needed, as you can see, is rather modest.

FPC Valkyrie / Problems with SVN Valkyrie
« on: January 10, 2008, 15:15 »
Kornel, have you broken something fundamentally with the latest Valkyrie?

I cannot compile 0.8.5 Berserk with it.


procedure TInput.Load(INIFile : TINI; CommandReader : TTokenReader);
  INICallbackProcedureReader := CommandReader;
  INIFile.QuerySection(@INICallbackProcedure); {this line outputs error}

E:\Elwin\Yhacking\Pascal\Valk\vrltools.pas(383,47) Error: Incompatible type for arg no. 1: Got "<address of procedure(const ShortString,const ShortString);Register>", expected "<procedure variable type of procedure(const AnsiString,const AnsiString);Register>"

If we look into

procedure QuerySection(inicallback : TINIFileCallbackProcedure);
type TINIFileCallbackProcedure = procedure (const nkey,nvalue : string);


Okay, I comment all the stuff. Then:


Menu := TTextMenu.Create(67,12,1);

bruichar.pas(162,35) Error: Incompatible type for arg no. 3: Got "ShortInt", expected "<procedure variable type of procedure(Byte) of object;Register>"


And it goes on and on and on...


Why is it important to have BRL compiling in spite of all the changes (as in "keeping up-to-date")? Well, since I use BerserkRL as a reference material for applying Valkyrie; and if it doesn't work, my Valkyrion project is effectively stalled :). Not that it's high priority or anything (you have DoomRL to take care of), but still it'd be nice if you could have a look at it some day.

p. s. Do you use jedi SDL for SDL?

p. p. s. Have you received my letter? It's not that I expect any answer, but usually you make some kind of a gesture indicating the letter was not lost in delivery stage.

FPC Valkyrie / "Destroy" method override in Vnode?..
« on: December 27, 2007, 04:35 »
       destructor  Destroy; override;

...even though it consecutively inherits from TVClass and TVObject, neither of which has defined destructor.


Berserk! / Berserk! branch
« on: January 21, 2007, 08:51 »
Now that we have the sources, it's the time I started tinkering with it... Since we can expect Kornel to implement everything that is reasonable and berserkish, we should stick to doing something mad and heretical.

To-do list is to be filled (suggestions welcome)... Things that I am currently considering:

1) Equipment: different weapon, armour and amulets.

2) Inventory: recoverable knives, cash, various useful artefacts.

3) Shops.

4) Story mode (this one will be so experimental, that it will be commented out for a time being)

5) "Preparation mode" a'la Horde with traps.

6) Difficulty modes.

Most of the new features will be optional and you will be able to toggle the on and off; toughness of monsters in order to balance things out will be adjusted throught the difficulty.

And yes, right now I'm aiming for "horrible unplayable variant with no balance at all"; it will take time and effort for things to take shape.

Discussion / Trait usefulness
« on: December 12, 2006, 07:53 »
Wiki's rather scarce of first-hand argumented info at the moment... I hope to hear your opinions on some of them.

Ironman\Tough as nails: Which one is better and when? Which one actually lends you longer lifetime? Should they be combined in a certain sequence to max out the advantage?

Finesse: AoM, I see. There's no loading time info for weapon in wiki... I remember someone saying that most of the time shotguns take for firing is their reload time... does that mean that actual shooting speed is negligible and Finesse is useless for them? What about chainguns?

Son of a bitch: Does it still apply to every shot of chaingun\plasmagun?

Eagle eye: How useful is it for shotguns (they seem to have very high hit chance, it's only wide spread that causes problems; does this trait help to cope with it somehow?)?

Juggler: "Best used: If you like to swap weapons over and over again". And when is it good to swap weapons ove and over again? Does anyone have effective strategy utilizing that (I can imagine wielding 2 rocket launchers or 2-barreled shotties; anything else?)? How long is the swap process anyway?

Stonewall: "If you're planning on a full win. Both the cyberdemon and final boss have ways to push you back". Is it that useful agains them? Have anyone taken it for something more than an experiment? Is it worth taking more than one level (maybe trait should have only one level and eliminate knockback?..)?

FPC Valkyrie / Inventory
« on: December 01, 2006, 11:46 »
(OK, this might better suit the "DiabloRL" forum, but I'll just pretend "Valkyrie" one is created for programming stuff... and it's pretty empty here anyway, so it isn't that much of littering)

Looks like I'm getting spoiled with all the goodies I found in Valkyrie, and ideology of "make games not engines" overcomes me more and more... There's lots of things to, *ahem*, "borrow" from BerserkRL (I guess the appropriate credit for everything I make would be "All the hard stuff: K. K. Anubis; All the fun stuff: *me*"), but there's one important thing missing: yep, you guessed right. Inventory&equipment. Hell, I feel confident enough with TNodes already to implement class-using inventory, but I don't know if it'd be worth reinventing the wheel (and it would be inferior one anyway)... The system you coded for DiabloRL works fine for me, and you mentioned that it's *possible* you will open-source it one day.

So yeah, generally it's a plea to release sources sooner rather than later; I'll make a good use of them *foxish grin*

Is everything *that* unoptimized, anyway?

FPC Valkyrie / TNode vs. TSystem
« on: November 26, 2006, 10:27 »
What is the difference between TNode and TSystem? As far as I can tell from the sources, TSystem is generally TNode with a little bit of logging attached. Is there any particular reason I should use it instead of TNode? Is a creature or an item a TSystem too? Or TSystem is a special kind of TNode designed for under-the-hood system things (input, output, etc), and I should tailor my own hierarchy with some TNode being a parent (World) and all other TNodes being connected to it? But documentation states that
"<Systems>'s the only TNode that should be allowed not to have a parent"
Does that mean that World is a System that is connected to the Systems (since you can't connect TNode to Systems)?

Requests For Features / Proposed Feature - locked doors
« on: October 24, 2005, 17:15 »
This one comes from locked door generation algorithm I was thinking about for Carceri, but what the hell - it could be used anywhere.

How it works:

1) Random map generator creates new room.

2) If room has 1 exit, then continue, else stop_check_locked.

3) If room has no stairs (maybe except for bonus ones) then continue, else stop.

4) If this is the last room to be generated, then stop, else continue (otherwise you won't be able to place keycard; I don't know if it's possible to return to previously created ones in order to do so, since you'll have to somehow check, if they are locked or not, and keycards should either be never locked, or locked in sequence, that is possible to follow)

...maybe some other conditions?

4) x\100 chance door gets one of 3 colours. If rolled succesfully, block entrance with door, generate keycard (and maybe some additional monsters around it; maybe additional items too).

This way it's impossible to make game unplayable by locking vital rooms, and searching for keycards allows to get some additional supplies...

Keycard can be not simple laying around, but carried by some monster not inside locked room... BTW, locked rooms should have indestructible walls or the whole point would be missed.

Actually, stairways can be locked too, but condition of only one exit should be met anyway; otherwise you'll get lost in uberdifficult checks...

Pages: [1]