Retro FPS


Delphi And RTTI… Moving Controls At Runtime

by on Sep.18, 2013, under giLE2D Dev

Developing giLE2D in Delphi 2010 has been GREAT FUN! I’ve been using Delphi since version 1 (1995).

I wanted to produce a map editor that would not rely on any expensive hardware acceleration, but still have good performance. Here enters TWinControl and its decendants, with the help of GDIPCustomItem…!

While in most situations you arrange all the controls on a Delphi form in a “fixed” position, there are situations when you need to allow a user to change the placement and dimension of controls at run-time.

This is the foundation of the editor… using run time type information (RTTI) to get the job done.

I played around with trying to use a TPanel with a child TImage control to represent sprites, but I just didn’t have the time to incorporate the flexibility I needed for such an object. I am, though, a proud licensee of the fabulous TMS Component library for Delphi. One of their controls gave me exactly what I needed to represent sprites.

The control, TAdvGlowButton, is a descendant of TWinControl (essential here, because I need a window handle HWND for reference). It comes with excess baggage, but I can strip this baggage using RTTI and inherit from it to implement my own interface to the object. It has an implementation of an interface to handle GDI image types, such as TGA and of course, the ubiquitous PNG, so painting and re-drawing the object, not to mention its support for embedded images, made it a no-brainer. The only concern was the GDI handle count under an OS like WinXP (which I do not intend to fully support anyway).

For example, I strip all of its MouseDown, MouseMove and MouseUp events and implement my own at runtime. That way, the end-user can drag and place the control anywhere on the map surface.

You end up getting a nice class implementation:

type   TMethodArray = array of TMethod;
 TMover = class(TComponent)   
     OnClickMethods : TMethodArray;   
    MouseDownMethods : TMethodArray;   
    MouseMoveMethods : TMethodArray;  
    MouseUpMethods : TMethodArray;   
    KeyDownMethods : TMethodArray;


All these event methods can be juxtaposed at my own whim (making the control either static or moveable).

For example, in the RTTI mousemove replacement:

procedure TMover.ControlMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
  minWidth = 20;
  minHeight = 20;
  newPos: TPoint;
  if inReposition then
    with TSpriteBlock(Sender) do // TWinControl
      Screen.Cursor := crSize;
      Left := Left - oldPos.X + newPos.X;
      Top := Top - oldPos.Y + newPos.Y;
      oldPos := newPos;
      // pass all sprite properties
      PopulateProperties(TSpriteBlock(Sender), fmMain.Inspector);
    pbGrid.Update; //Repaint;
    NeedSave := True;

Totally Delphi, totally not much code and TOTALLY re-useable!! Delphi really kicks ass… it amazes me still!

As you may have guessed, TSpriteBlock is the inherited class from TAdvGlowButton! Great!

Anyway, hope this insight has been interesting to geeks and non-geeks alike!

Comments Off on Delphi And RTTI… Moving Controls At Runtime :, , , more...

ATTA – We Will Adopt FPSC Reloaded!

by on Sep.17, 2013, under Dev


You know, that feeling you get when you’re not sure that you’re doing the right thing, and that?

Well, we went into decidedly what could be called, and for want of a better word, “Duke Nukem Forever” mode. Yes, that’s right, we are holding off until the incredible Lee “Gascoigne” Bamber finishes up the new, and, if we may be so bold and tigerish, awesome FPSC Reloaded engine.

You can read all about Lee’s adventures in FPSCR land here:

It’s a must read! Fantastic insight from a veteran industry pro!

Anyway, ATTA is sure to be a complete pants filler of a game once we get our hands on Lee’s new tech!

Stay tuned!

Comments Off on ATTA – We Will Adopt FPSC Reloaded! more...

giLE2D – Screenie

by on Sep.16, 2013, under giLE2D Dev

A screenie!

Mmmm.. Edit Background please!

Mmmm.. Edit Background please!

11 Comments :, more...

Help System Dev For giLE2D Begins!

by on Sep.15, 2013, under giLE2D Dev

Well… giLE2D is finally taking shape!

With the core code done, its up to the in-house beta guys to tell me where all the bugs are.

Its on to help system authoring now, the bane of any dev!

I’ll be releasing more YouTube videos regarding giLE2D within the coming couple of weeks, so stay tuned!

The help system will be browser based (html), with embedded YouTube videos to help illustrate each topic where applicable.


Here’s a quick couple of screenies:





Comments Off on Help System Dev For giLE2D Begins! :, more...

Dev Journal – Entry 3

by on Nov.27, 2012, under Dev

Well, how the hell do you program some tricks ‘n’ traps when the physics engine doesn’t obey the laws of physics?

Answer(s): You re-write the engine source (loooong) or you hack a work-around (sometimes loooong).

We like efficiency. We like fast framerates, even on cowpat rigs. We like sweet!

“Mongo Like Candy!” Mongo, Blazing Saddles, 1974

In developing ATTA, as we have progressed, we have learned some neat tricks. But it’s annoying when the sales machinery decides to show them off coz they think that this’ll make ’em a fat dough-ball.

They even released a pre-ALPHA dev video (COMPLETE WITH A MIS-SPELLING OF “PREVIEW”) of level 9 (ATTA).

I said:

“…WTF are you releasing a pre-alpha play test video for ya —expletive– morons? I wish sales people were forced to drown in a quagmire of their own —expletive– shite and vomit. And then drink it… and then bring me beer… Leave me alone to get this —expletive–  game done, bastards.

Needless to say, I got my beer.


Are you taking the pish…?

BTW, don’t look at the video, coz I’m gonna change everything to be crap, just to piss off the sales creeps. (soz).

Comments Off on Dev Journal – Entry 3 more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


A few highly recommended websites...