PDA

View Full Version : The Probe



paul_nicholls
08-09-2010, 03:08 AM
Hey all,
I have now moved from this using thread about "The Probe"

http://www.pascalgamedevelopment.com/forum/index.php?topic=6262.0

to here now since I am not using Pyrogine any more, but HGE :)

Anyway, I am currently doing some menus for my game and have decided to use Delphi to help me design them!

I am attempting to use the Delphi IDE to design the menus to "cheat" and save time LOL

http://a.imageshack.us/img268/3927/delphiasamenueditor.th.png (http://img268.imageshack.us/i/delphiasamenueditor.png/)

I will then write a routine to export the control information from the forms to some output I can then read into my game, and bingo!

cheers,
Paul

Hadron Games
08-09-2010, 03:42 AM
Cool stuff.

If you where not aware, see the Menu_XXX routines in HGE as well, they may be able to help now and/or in the future. The menu stuff is pretty flexible with a range of call backs allowing for lots of customization. I can send some sample code that shows it's basic use if need be.

paul_nicholls
08-09-2010, 04:13 AM
Cool stuff.

If you where not aware, see the Menu_XXX routines in HGE as well, they may be able to help now and/or in the future. The menu stuff is pretty flexible with a range of call backs allowing for lots of customization. I can send some sample code that shows it's basic use if need be.

Thanks man :)

I will take a gander at the routines ;)

cheers,
Paul

chronozphere
08-09-2010, 08:29 AM
Hey Paul,

It's looking really solid. I should try it sometime. :)

Why did you switch to HGE btw? Is HGE the successor of Pyrogine?

Keep it up! ;)

paul_nicholls
08-09-2010, 08:37 AM
Hey Paul,

It's looking really solid. I should try it sometime. :)

Why did you switch to HGE btw? Is HGE the successor of Pyrogine?

Keep it up! ;)


Thanks Nathan :)

I switched as Pyrogine was replaced by HGE as you suspected ;)

cheers,
Paul

paul_nicholls
08-09-2010, 10:22 PM
Thanks to Jarrod (bless his heart), I now have my own domain name for The Probe:

http://theprobegame.com/

Woo! Hoo!

cheers,
Paul

Hadron Games
08-09-2010, 11:02 PM
http://window.punkave.com/wp-content/uploads/2009/12/cheers.jpg

paul_nicholls
08-09-2010, 11:22 PM
:D Brilliant!

Cheers yourself <insert beer here>...<clink of glasses>

cheers,
Paul

Traveler
08-09-2010, 11:45 PM
Congrats on your new domain :)

paul_nicholls
09-09-2010, 12:35 AM
Congrats on your new domain :)


Thanks chief :)

Update:

I now have music in The probe!

Thanks to Patrick, also known by the name Major-Davis (http://major-davis.deviantart.com/), I now have a tune I am using for my main menu screens, but as I don’t actually have any menus yet, it is my game music instead for now! LOL

Thanks again Patrick!

Check out the latest download (http://theprobegame.com/index.php/downloads-2) from the site (6.1Mb 7-Zip file, Windows only)

cheers,
Paul

chronozphere
09-09-2010, 08:02 AM
Thanks to Patrick, also known by the name Major-Davis (http://major-davis.deviantart.com/), I now have a tune I am using for my main menu screens, but as I don’t actually have any menus yet, it is my game music instead for now! LOL


I can't find any music on his page. Maybe it's just me looking at the wrong place. Where is it? :)

Also, how did you find him so quickly? I STILL need to find someone who let me use his/her music in my IGF entry.

paul_nicholls
09-09-2010, 08:10 AM
Thanks to Patrick, also known by the name Major-Davis (http://major-davis.deviantart.com/), I now have a tune I am using for my main menu screens, but as I don’t actually have any menus yet, it is my game music instead for now! LOL


I can't find any music on his page. Maybe it's just me looking at the wrong place. Where is it? :)

Also, how did you find him so quickly? I STILL need to find someone who let me use his/her music in my IGF entry.


LOL! I can't actually find any music on his page either, but I first heard of him on the page below where he donated a song to another musician called C418

http://c418.org/?p=486

I really liked the tune so I contacted c418 who gave me Patrick's email and got permission to use the track :D

BTW, I am also allowed to use C418's songs however I want too if I like any of them, and so can you :)

Patrick's email is this:

patrick AT australis-dev DOT net

Perhaps he has some more songs? I don't know :)

cheers,
Paul

paul_nicholls
10-09-2010, 12:57 PM
Hey all,
I have updated my site (http://theprobegame.com) so you can now (hopefully, not tested) subscribe using RSS, or by email :)

cheers,
Paul

virtual
10-09-2010, 02:40 PM
Congrats

paul_nicholls
15-09-2010, 04:15 AM
Hey all,
I have now gotten into The Probe a main menu with scrolling credits at the bottom!

I just have to use my BBCode parser to parse the credits text instead of me adding the different parts of the credits maually LOL

here is a screenshot:
http://img825.imageshack.us/img825/897/mainmenuscreenshot.th.png (http://img825.imageshack.us/i/mainmenuscreenshot.png/)

I haven't uploaded this version yet though...

cheers,
Paul

Traveler
15-09-2010, 11:50 AM
Looks good! Are you planning on having something in the background? Currently it looks a bit boring to me.

Stoney
15-09-2010, 12:00 PM
I agree. It looks really good. What font are you using for the main menu?

paul_nicholls
15-09-2010, 12:38 PM
@Traveler: Thanks :) I was thinking of something in the background, but I have no idea what yet.

In the game itself, there is a nebula...perhaps I could do similar here too?

I am also thinking of adding a couple of staggered columns of game wall tiles on the sides of the menu screens (o = wall tile):


o oo
oo o
o oo
oo o
o oo
oo o
o oo
oo o

The plan is to make these columns fill into the center of the screen and back again like a door to change between screens too :)

@Stoney: Thanks for the kind words :) I am using the font from here:

http://www.dafont.com/search.php?psize=m&q=bladerunner

I downloaded it, and used Nitrogen's Font Studio to make 2 sized fonts for the game :)

cheers,
Paul

WILL
15-09-2010, 04:32 PM
Hey I've got an idea for ya... the background you could have a video flicker effect throw in some 'video static' and you could also have that nebula effect with an old TV scanline effect too. Make it look like a probe video feed. :) You can combine it with your columns idea too.

Traveler
15-09-2010, 07:12 PM
I suppose anything would do. I think my vote would go to sort of an artistic visualization of a level, like for example how you did the header on your website. The title perhaps could be composed of those gray blocks.
Also, I would not align the menu like that, unless there is a good reason for it of course, such as an image that is placed next to it and the menu is aligned to follow a pattern to match the image. Centered alignment is usually the best way to go.

paul_nicholls
15-09-2010, 10:20 PM
Thanks WILL and Traveler for the ideas :)

I will see what I can come up with ;)

I WILL (pun intended!) change the heading to more closely match the website header though - it would look better LOL

cheers,
Paul

paul_nicholls
16-09-2010, 02:26 AM
I have update The Probe site again (http://theprobegame.com).

Has a new post, and have uploaded the latest version to boot :)

Please let me know what you think of the main menu now ;)

cheers,
Paul

farcodev
19-09-2010, 03:35 PM
it works cool under firefox, clean sit.

good job ;)

paul_nicholls
27-10-2010, 04:28 AM
Hey all,
I haven't uploaded the latest version yet, but I have been playing with a new element in The Probe...a Sentry.

http://img89.imageshack.us/img89/6661/screenshotlz.th.png (http://img89.imageshack.us/i/screenshotlz.png/)

The Sentry has a rotating beam that if it hits the player, then an energy discharge hits the player causing damage. If you take too much damage, you die.

At the moment, it zaps the player if in range regardless of the beam's location - I need to work out the collision detection yet (see this thread if you think you can help [http://www.pascalgamedevelopment.com/showthread.php?6270-Circle-vs-pie-segment-collision-detection]):

I have also changed the crystals graphic, and made it so there are different colours available when designing levels - looks much nicer I think :)

PS. A person playing the game can now use a game controller to play (yay!), and can even configure the keys & game controller button use to control the game!!

cheers,
Paul

paul_nicholls
03-11-2010, 03:38 AM
I have a question for you all regarding some graphics for The probe...

I want to represent the probe's "health" using some sort of graphic, and I was thinking that a spanner would look good (as the player is a robotic probe...):

124

If I had this added to the head up display with a percentage next to it (0-100), and have the icon also as a collectable in-game to recover health, do you think this is intuitive enough to represent the player's health in the game?

See the possible HUD screenshot below:

http://img38.imageshack.us/img38/9177/hudscreenshot.th.png (http://img38.imageshack.us/i/hudscreenshot.png/)

I am also playing with the health power-up box colour too...any suggestions would be nice :)

cheers,
Paul

Traveler
03-11-2010, 11:08 AM
Yeah, I think that would work quite well. It's not an uncommon icon in games. The blue frame around the spanner doesn't really fit imo though (color-wise).
I toyed in Lightwave for a bit and came up with this animation (http://www.gameprogrammer.net/pics/outside/spanner.swf). Here is the animationstrip: http://www.gameprogrammer.net/pics/outside/spanner_strip.png.
The light reflection is perhaps a bit strong in this one, but I can change that if you want to.

paul_nicholls
03-11-2010, 11:23 AM
Thanks for the tip, and especially the animation :)

Not sure I want to make the spanner spin, but neat!

cheers,
Paul

code_glitch
03-11-2010, 03:58 PM
Can I just say, that this also works a treat on wine 1.3.6 on ubuntu 10.10. Frankly, I think every pascal program so far is turning out to work VERY well. Clocked around 50fps with 20-35% cpu usage. Nice work.

paul_nicholls
03-11-2010, 07:31 PM
Can I just say, that this also works a treat on wine 1.3.6 on ubuntu 10.10. Frankly, I think every pascal program so far is turning out to work VERY well. Clocked around 50fps with 20-35% cpu usage. Nice work.

Thanks for the feedback code_glitch, much appreciated :)

cheers,
Paul

paul_nicholls
06-11-2010, 04:32 AM
Hi all,
I am wanting to add into The Probe some sort of liquid/goop/acid, etc. that will over time damage and then destroy crystals/rocks/the probe? that are touching it.

I could just put into the game liquid as static 32x32 tiles (possibly animated) like the rest of the tiles in the game, but it would look silly if the ground got blown up underneath it and the liquid didn't fall, or an object exploded in it, destroying some of the liquid - leaving a hole.

Thinking about it, I want to have an outlet somewhere and have liquid coming out of it.

The liquid should fall down, and fill up tile squares once it has hit the bottom.

So I guess I might need to use particles?

Any ideas?

EDIT: I guess if I didn't use particles, I would want to do something similar to boulder dash rocks! in this video:


http://www.youtube.com/watch?v=zWzaqa5d4n0

See 1:02 minutes onwards for the first bit of falling water...

cheers,
Paul

paul_nicholls
06-11-2010, 06:13 AM
Here is another screenshot of boulder dash rocks! water:

126

cheers,
Paul

WILL
06-11-2010, 07:06 AM
Hey, your video didn't post Paul. Was it YouTube or something else?

Liquid and/or Goop = Awesome visual effect! :D I love water in games and demos to be honest. Something about the semi-artificial effect in the visuals that's just really beautiful to see on the screen.

You could mix in particles for the falling water and perhaps some kind of water/goop effect on the squares/tiles that contain the water/goop.

paul_nicholls
06-11-2010, 07:27 AM
Hey, your video didn't post Paul. Was it YouTube or something else?

Liquid and/or Goop = Awesome visual effect! :D I love water in games and demos to be honest. Something about the semi-artificial effect in the visuals that's just really beautiful to see on the screen.

You could mix in particles for the falling water and perhaps some kind of water/goop effect on the squares/tiles that contain the water/goop.

Hey WILL, yeah the video is YouTube, and I can see + play it just fine...

I will have a go at particles for the falling water + some tile drawing and see how it goes :)

cheers,
Paul

WILL
06-11-2010, 10:26 AM
Hey WILL, yeah the video is YouTube, and I can see + play it just fine...

Wouldn't you know it. As soon as I post that I got to see it. lol I guess my web browser or my ISP is to blame. :P

paul_nicholls
10-11-2010, 11:57 PM
Hey all, I have updated The probe website with a video of the Sentry in action:

http://theprobegame.com/index.php/videos

Please excuse the low FPS as it was caused by the video cature :(

cheers,
Paul

paul_nicholls
12-11-2010, 05:59 AM
Oh No! Another update...GASP!! LOL :D

http://theprobegame.com/

cheers,
Paul

paul_nicholls
15-11-2010, 10:01 AM
Bump ;)

cheers,
Paul

paul_nicholls
04-02-2011, 02:11 AM
Hey all, I haven't done much with The Probe lately, but I have now added a new subscription option on the website:

http://theprobegame.com

Now you can use RSS, Email, or Twitter (theprobegame)

:)

cheers,
Paul

paul_nicholls
05-03-2011, 10:40 AM
Hi all,
I have actually gotten around to doing more of The Probe game...yay!

I have gone back to basics, and created a completely new boulder dash physics engine, and a simple program using that to test out the physics + other ideas and effects :)

Once I am happy with the boulder dash engine, I will plug that back into the main The Probe game...

Here is some video of the new engine, and you can see some acid dissolving items that fall into it :)

291

http://fpc4gp2x.eonclash.com/videos/Prototype/The%20Probe_Prototype.html

cheers,
Paul

WILL
08-03-2011, 01:23 AM
I'm a little late, but nice job!

So this game is going to be put on the GP2X system huh? Have you been able to test it out on the actual console yet?

Continue posting videos as you progress please. ;)

paul_nicholls
08-03-2011, 02:48 AM
I'm a little late, but nice job!

LOL Thanks Jason :)


So this game is going to be put on the GP2X system huh? Have you been able to test it out on the actual console yet?

I haven't even tried to make a GP2X version to be honest, but with the way I am making the new 'boulder dash' engine, it is completely separate from how I actually render the output of the game, do audio, and how I get input too, which is uber-awesome ;D

This means that theoretically I should be able to port the game onto pretty much any platform I choose in the future.. I just have to decide how I do the graphics/input/sound on that system.

For example I SHOULD be able to make a cross-platform SDL/OpenGL version, or just use SDL (graphics/sound/input) on the GP2X (not sure how fast it would run though... :D).


Continue posting videos as you progress please. ;)

I certainly will keep doing updates here in PGD land, don't you worry about that laddie! :)

cheers,
Paul

paul_nicholls
10-03-2011, 10:34 AM
Hey all,
I'm quite pleased with myself, I've managed to get a bunch more done with my 'boulder dash' engine for The Probe :)

The Probe avatar can:

Collect crystals, tunnel through dirt, push rocks and radioactive elements (using move, or move + fire).
Push TLS deflectors using move.
Smoothly rotate TLS deflectors (using move + fire).


Current enemies:

Cruiser - explodes into spaces when adjacent to the Probe, or hit by falling rocks/crystals.
Drone - explodes into crystals when adjacent to the Probe, or hit by falling rocks/crystals.

Cruisers and Drones now rotate smoothly when turning corners which is very nice :)

Environmental Hazzards:

Acid - dissolves rocks/crystals/radioactive elements.


TODO List:

Switches.
Teleporters.
Warps.
TLS Emitter.
TLS Receiver


cheers,
Paul

Traveler
10-03-2011, 01:45 PM
It sounds like you're going to have plenty of different gameplay mechanics. Are you already testing with levels?

paul_nicholls
10-03-2011, 08:09 PM
Hi Traveler :)

Yeah, I am testing mechanics with a bunch of quickly whipped up levels using ascii characters...it is great for testing stuff, though I will fix my level editor so it works with the new code later on.


procedure TTheProbe.LoadLevel;
var
w,h,x,y: Integer;
c: Char;
sl: TStringList;
begin
sl := TStringList.Create;
try
{
sl.Add('TTTTTTTTTTTTTTTTTTT');
sl.Add('T.................T');
sl.Add('T...O ...........T');
sl.Add('T...OP...C..2C..C.T');
sl.Add('TTTTO TT ..W ....T');
sl.Add('T1OTTT.T. ... ....T');
sl.Add('TT...T.TW ... ..D T');
sl.Add('TT.TTT... ... .. T');
sl.Add('TW.W..............T');
sl.Add('TT.CT...... O.. T');
sl.Add('T...T........O.. DT');
sl.Add('T.......... O....T');
sl.Add('TTTTTTTTTTTTTTTTTTT');}



{ sl.Add('TTTTTTTTTTTTTTTTTTTTTTT');
sl.Add('TO333OO11 O T');
sl.Add('TO111OW12 d O1 T');
sl.Add('TO222OW13 311 T');
sl.Add('TWOOOW11W TWWWWT');
sl.Add('TWWPWW W WRWWWT');
sl.Add('T WRW T');
sl.Add('TOOOOOT WRW T');
sl.Add('TOOOOOT WRW T');
sl.Add('TOOOOOT WRW DT');
sl.Add('TAAAAAT RRRRRRRRRRR CT');
sl.Add('TTTTTTTTTTTTTTTTTTTTTTT');}


sl.Add('TTTTTTTTTTTTTTTTTTTTTTTT');
sl.Add('T T');
sl.Add('T TTTTTTTTTTTTTTTTTTTT T');
sl.Add('T TOOOOOOOOOOOOOOOOOOT T');
sl.Add('T TDDDDDDDDDDDDDDDDDDT T');
sl.Add('T TCCCCCCCCCCCCCCCCCCT T');
sl.Add('T TDDDDDDDDDDDDDDDDDDT T');
sl.Add('T TCCCCCCCCCCCCCCCCCCT T');
sl.Add('T TCCCCCCCCCCCCCCCCCCT T');
sl.Add('T T444444444444444444T T');
sl.Add('T T411122233322211114T T');
sl.Add('T T444444444444444444.PT');
sl.Add('T TTTTTTTTTTTTTTTTTTTT T');
sl.Add('T T');
sl.Add('TTTTTTTTTTTTTTTTTTTTTTTT');

{
sl.Add('TTTTTTTTTTTTTTTTTTT');
sl.Add('TOOOOOOOOOOOOOOOOOT');
sl.Add('TOOOOOOOOOOOOOOOOOT');
sl.Add('TDDDDDDDDDDDDDDDDDT');
sl.Add('TDDDDDDDDDDDDDDDDDT');
sl.Add('TDDDDDDDDDDDDDDDDDT');
sl.Add('TDDDDDDDDDDDDDDDDDT');
sl.Add('TDDDDDDDDDDDDDDDDDT');
sl.Add('T22222222222222222T');
sl.Add('T22222222222222222T');
sl.Add('TP1111111111111111T');
sl.Add('TTTTTTTTTTTTTTTTTTT');
}

w := Length(sl.Strings[0]);
h := sl.Count;

FBDCEngine.SetBounds(3,w,h);

for y := 0 to h - 1 do
for x := 0 to w - 1 do
begin
c := sl.Strings[y][x + 1];

case c of
'.' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjDirt);
'W' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjBrickWall);
'O' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjRockStationary);
'1' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCrystal1Stationary);
'2' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCrystal2Stationary);
'3' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCrystal3Stationary);
'4' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCrystal4Stationary);
'5' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCrystal5Stationary);
'T' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjTitaniumWall);
'A' : FBDCEngine.SetObjectAt(cMaxLayer,Position(x,y),cOb jAcidFull);
'd' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjTLSDeflector_u);
'P' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjProbe);
'R' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjRadioactiveStationary);
'V' : FBDCEngine.SetObjectAt(cLowestLayer,Position(x,y), cObjVortex);
'C' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjCruiser_d);
'D' : FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjDrone_u);
else
FBDCEngine.SetObjectAt(cMainLayer,Position(x,y),cO bjSpace);
end;
end;

finally
sl.Free;
end;
end;


I will post some more example screenshots later today of some test levels :)

cheers,
Paul

code_glitch
10-03-2011, 09:45 PM
ooof... hard coded maps - that is super harsh there. Personally, I have never used them except for a 2x2 grid I once used to proof my map drawing before proceeding with the editor... heavy stuff. Lots of features though so looking forward to this one.

paul_nicholls
10-03-2011, 10:21 PM
ooof... hard coded maps - that is super harsh there. Personally, I have never used them except for a 2x2 grid I once used to proof my map drawing before proceeding with the editor... heavy stuff. Lots of features though so looking forward to this one.

LOL! I guess it IS harsh :D

It IS a very easy/quick way of testing/prototyping my different elements in the game though :)

As I said, I will upgrade my level editor that I already made for The Probe to work with the updated code base so I don't have to do ASCII hard coded maps any more ;)

cheers,
Paul

WILL
12-03-2011, 12:53 AM
Well hard coded might not be the best way for a regular computer game, but for a console based one it might be a good idea. ;)

It's funny, but your level maps look a lot like mine I use for Subject 33. I figure it's gotta be the best way to make it easy to switch something in a map by making the data all ASCII. As long as the maps can be interpreted that way.

Jonax
14-03-2011, 11:19 AM
The screenshots look much better than the ascii-levels :-X IMHO

paul_nicholls
14-03-2011, 07:48 PM
Thanks Jonax :)

cheers,
Paul

code_glitch
14-03-2011, 08:27 PM
I must say I do do one thing very differently in terms of maps. I have a tendency to go towards developing a layered format which stores data in 2d csv array between meta style tags. Each array corresponds to each layer. Then there is a LOT of tags that define 'objects' so whereas floor, terrain, rocks, caves, walls and etc are defined as tiles in the 2d arrays, an object might be a person, chair, TV and others you can interact with. Also, each object has a script file so it can edit X,Y positions, the shown image and etc. The map itself also has a script file in case you want it to change dynamically. Quite a bit more complicated which I guess is why I have a right job in making editors to work with it all. Especially the 20th odd revision of this format. This map editor is indeed proving exceptionally tricky. :)

I like the touch where you store data as T, 0,1,W and etc... I might start doing that to replace my Integer tile codes ;) once I get the latest revision optimised. It only does 35 odd fps when drawing a total 7,000 elements at 800x600 32bpp whereas earlier formats reached 175fps in equal element counts. Darn. Opengl Should give that a right change I hope.

paul_nicholls
14-03-2011, 09:58 PM
I must say I do do one thing very differently in terms of maps. I have a tendency to go towards developing a layered format which stores data in 2d csv array between meta style tags. Each array corresponds to each layer. Then there is a LOT of tags that define 'objects' so whereas floor, terrain, rocks, caves, walls and etc are defined as tiles in the 2d arrays, an object might be a person, chair, TV and others you can interact with. Also, each object has a script file so it can edit X,Y positions, the shown image and etc. The map itself also has a script file in case you want it to change dynamically. Quite a bit more complicated which I guess is why I have a right job in making editors to work with it all. Especially the 20th odd revision of this format. This map editor is indeed proving exceptionally tricky. :)

I like the touch where you store data as T, 0,1,W and etc... I might start doing that to replace my Integer tile codes ;) once I get the latest revision optimised. It only does 35 odd fps when drawing a total 7,000 elements at 800x600 32bpp whereas earlier formats reached 175fps in equal element counts. Darn. Opengl Should give that a right change I hope.

Hey code_glitch, you do realise that I'm not actually going to use ASCII characters as levels in my final game? I am going to use my level editor that I wrote for The Probe earlier on...it uses binary files to load/save levels.

Good luck with your level editor dude :)

cheers,
Paul

code_glitch
15-03-2011, 07:42 AM
Ah, that does explain things a lot, guess you have some mighty small map files then since the engine seems to handle it all. I might have to give that a go to try and improve performance on mine. Good luck on the probe, looks like you made a lot of ground with this one. :)

paul_nicholls
16-03-2011, 12:37 AM
My level map files in The Probe are just simple 2d arrays of a TEngineObject record, one array for each layer in the map...


TEngineObject = record
Enabled: Boolean;
Health: Single;
Moving: Byte;
OfsX: Single;
OfsY: Single;
case Integer of
0: (Id,Attrib,Scanned,Stationary: Byte);
1: (Value: LongWord);
end;


Here is my load/save code I am now using in The Probe prototype (levels are binary files):



procedure TTheProbeEngine.SaveToStream(const aStream: TStream);
var
w,h,L: Word;
Layer,x,y: Word;
begin
w := FWidth;
h := FHeight;
L := FLayerCount;

aStream.Write(w,SizeOf(w));
aStream.Write(h,SizeOf(h));
aStream.Write(L,SizeOf(L));
aStream.Write(FUpdateCount,SizeOf(FUpdateCount));

for Layer := 0 to FLayerCount - 1 do
for y := 0 to FHeight - 1 do
begin
for x := 0 to FWidth - 1 do
begin
aStream.Write(FLayers[Layer][y,x],SizeOf(TEngineObject));
end;
end;
end;

procedure TTheProbeEngine.LoadFromStream(const aStream: TStream);
var
w,h,L: Word;
Layer,x,y: Word;
begin
aStream.Read(w,SizeOf(w));
aStream.Read(h,SizeOf(h));
aStream.Read(L,SizeOf(L));
aStream.Read(FUpdateCount,SizeOf(FUpdateCount));

SetBounds(L,w,h);

for Layer := 0 to FLayerCount - 1 do
for y := 0 to FHeight - 1 do
begin
for x := 0 to FWidth - 1 do
begin
aStream.Read(FLayers[Layer][y,x],SizeOf(TEngineObject));
end;
end;
end;

procedure TTheProbeEngine.LoadFromFile(const aFileName: AnsiString);
var
fs: TFileStream;
begin
fs := TFileStream.Create(aFileName,fmOpenRead or fmShareDenyWrite);
try
LoadFromStream(fs);
finally
fs.Free;
end;
end;

procedure TTheProbeEngine.SaveToFile(const aFileName: AnsiString);
var
fs: TFileStream;
begin
fs := TFileStream.Create(aFileName,fmCreate or fmShareDenyWrite);
try
SaveToStream(fs);
finally
fs.Free;
end;
end;


Maybe this will help you?

cheers,
Paul

paul_nicholls
16-03-2011, 05:30 AM
Hey all,
I have now started sending updates via my Twitter account (http://twitter.com/theprobegame) :)

So feel free to follow me there too ;)

cheers,
Paul

dazappa
16-03-2011, 10:55 PM
Heh, I find that any time I try to use a tile based system, I always make it extremely complicated very fast, which ends up forcing me to implement file loading earlier. Most of the time, I use Tiled as my map editor of choice, and depending on what I am deploying, will either use XML or CSV exporting. Very handy! ;)

paul_nicholls
16-03-2011, 11:52 PM
Tiled sounds neat, but I'm going to 'roll my own' :)

I already have some very cool ideas for my updated level editor...


If a tile is added above/below the existing tiles, the editor will insert a row above/below the rows already there to accommodate the new tile being placed, and similar for the columns.

Pan the map with the cursor keys or other keys, place tiles with the mouse.

Make the map editor use the in-game engine for ease of use, and not be a separate GUI program.


cheers,
Paul

code_glitch
17-03-2011, 07:36 AM
Hay dazappa, I'm with you on that one TileD all the way, but TileD does not do scripting for my maps, and objects which is why I'm having a nice time making a map editor.

Cheers for that snippet paul. large help and the personification of simplicity... My load/save procedures are usually upwards of 200 lines. 100 and up after they are stripped bare for speed. My tests point at loading at around 80kbytes/sec which for a 1mb map file is quite a long time ;)

paul_nicholls
17-03-2011, 11:01 AM
Cheers for that snippet paul. large help and the personification of simplicity... My load/save procedures are usually upwards of 200 lines. 100 and up after they are stripped bare for speed. My tests point at loading at around 80kbytes/sec which for a 1mb map file is quite a long time ;)

"personification of simplicity" - I love it! :D

Glad I could shed some light on your problems :)

cheers,
Paul

dazappa
17-03-2011, 08:23 PM
Tiled does support objects, but no scripting. Personally I don't mind having level data separated into multiple files (so, eg: properties or mini scripting in one file and the map data in another), but I can understand the preference for it being all self contained.

I'd go with Paul, in that if you want to roll your own map editor you should do it in the game itself. This way, you can easily deploy the map editor for everyone to enjoy ;)

paul_nicholls
21-03-2011, 04:54 AM
I thought I'd share how I'm going with my new editor for The Probe...

http://img801.imageshack.us/img801/5518/theprobeeditor.th.png (http://img801.imageshack.us/i/theprobeeditor.png/)

I am doing it all in-game, and even using my Immediate Mode GUI system I was using for The Probe setup screens...this makes it easy to do input :)

I can register tiles with the editor, and click on them to select one. I can't put it into the level yet, but that shouldn't take long...

The selectable tiles are buttons (hidden) with a graphic over the top, and I have check boxes to show/hide layers.

As a nice bonus, everything animates because the editor is now part of the game :)

cheers,
Paul

code_glitch
21-03-2011, 08:09 PM
Hmm, that is quite nice indeed. Although I've drawn up the next version of my map rendering engine and file formats (yes, I haven't even finished the current version) animation will not be present in the editor for quite some time yet... I'm still using my Dec 2009 code for saving/loading and I am starting to really wish I'd added comments in some areas where it's going funny. I think the main problem are the data array offsets since the code was written over 14 months some arrays start at 0 and others at 1 which means everything gets the wrong data :(. Guess I should re-write most of it but I'm a tad lazy.

Although I've taken a new, fully object-oriented approach to this editor and we now softlink procedures. Hell to debug, but its absolutely fantastic. Check out the Ini procedure for the editor:


PrometheusVid_Start();
CreateWindow(800, 600, 32);
UpdateWindow();

PrometheusCore_Start();

//Some default values...
OSTime := 40;
OSTimeActive := 5;

//Get the fonts for the system
SystemFont.Load('resources/MapEditor/System/Font.ttf', 16);
SystemFontColour.SetRGBA( 250, 10, 10, 10);

//Set up those toolbars...
Toolbars := 1;
Toolbar[1].PositionX := 1;
Toolbar[1].PositionY := 1;
Toolbar[1].IconCount := 5;
Toolbar[1].IconPath := 'resources/MapEditor/Toolbar/T1Icon.png';
Toolbar[1].IconAction[1] := @Action_Open;
Toolbar[1].IconAction[2] := @Action_Save;
Toolbar[1].IconAction[3] := @Action_New;
Toolbar[1].IconAction[4] := @Action_Settings;
Toolbar[1].IconAction[5] := @Action_Exit;
Toolbar[1].Initialize();


And that is literally all of the initialisation code ;)

PS: And of course, its all prometheus code XD I just couldnt pass up a testing opportunity and some of (in my opinion) easy and fast as hell functions/procedures. lol.

paul_nicholls
21-03-2011, 11:12 PM
Hmm, that is quite nice indeed. Although I've drawn up the next version of my map rendering engine and file formats (yes, I haven't even finished the current version) animation will not be present in the editor for quite some time yet... I'm still using my Dec 2009 code for saving/loading and I am starting to really wish I'd added comments in some areas where it's going funny. I think the main problem are the data array offsets since the code was written over 14 months some arrays start at 0 and others at 1 which means everything gets the wrong data :(. Guess I should re-write most of it but I'm a tad lazy.

Although I've taken a new, fully object-oriented approach to this editor and we now softlink procedures. Hell to debug, but its absolutely fantastic. Check out the Ini procedure for the editor:


PrometheusVid_Start();
CreateWindow(800, 600, 32);
UpdateWindow();

PrometheusCore_Start();

//Some default values...
OSTime := 40;
OSTimeActive := 5;

//Get the fonts for the system
SystemFont.Load('resources/MapEditor/System/Font.ttf', 16);
SystemFontColour.SetRGBA( 250, 10, 10, 10);

//Set up those toolbars...
Toolbars := 1;
Toolbar[1].PositionX := 1;
Toolbar[1].PositionY := 1;
Toolbar[1].IconCount := 5;
Toolbar[1].IconPath := 'resources/MapEditor/Toolbar/T1Icon.png';
Toolbar[1].IconAction[1] := @Action_Open;
Toolbar[1].IconAction[2] := @Action_Save;
Toolbar[1].IconAction[3] := @Action_New;
Toolbar[1].IconAction[4] := @Action_Settings;
Toolbar[1].IconAction[5] := @Action_Exit;
Toolbar[1].Initialize();


And that is literally all of the initialisation code ;)

PS: And of course, its all prometheus code XD I just couldnt pass up a testing opportunity and some of (in my opinion) easy and fast as hell functions/procedures. lol.

Nicely done...it looks good :)

cheers,
Paul

paul_nicholls
06-04-2011, 06:07 AM
I have now gotten the Teleport Laser System (TLS) added into the new physics engine for The Probe...yay! :D

I am now working on getting the Sentry up and zapping now...

cheers,
Paul

paul_nicholls
08-04-2011, 03:06 AM
Here is a video of the TLS system in action in the physics engine (also available in HD too):


http://www.youtube.com/watch?v=Ho_g9gB1KGM

cheers,
Paul

Traveler
08-04-2011, 11:16 AM
Sigh, I envy you

paul_nicholls
08-04-2011, 10:42 PM
Sigh, I envy you

Why do you envy me?

It's taken me since mid 2010 (I think) to get this far, in lots of fits and starts LOL :)

cheers,
Paul

farcodev
08-04-2011, 11:09 PM
wow your game rocks ! you really made a great work ! ;)

paul_nicholls
08-04-2011, 11:20 PM
wow your game rocks ! you really made a great work ! ;)

Thanks!

cheers,
Paul

WILL
09-04-2011, 01:57 AM
In all seriousness, please tell me you are porting this to Mac so I can play it. :) It looks fun.

paul_nicholls
09-04-2011, 03:14 AM
In all seriousness, please tell me you are porting this to Mac so I can play it. :) It looks fun.

I would love to Jason, but:

a) I haven't got any flavour of Mac at all.
b) I haven't had any luck in trying to install Mac OSX inside of a virtual machine to be able to do tests, etc.

cheers,
Paul

Traveler
09-04-2011, 10:21 AM
It's taken me since mid 2010 (I think) to get this far, in lots of fits and starts LOL :)l

While that may be so, at the end of the day, it's not how long it took you, it's where you are that counts. ;)

paul_nicholls
09-04-2011, 10:40 AM
While that may be so, at the end of the day, it's not how long it took you, it's where you are that counts. ;)

Ok, that is a fair cop! LOL :)

I have to say that I am really pleased with how the rewrite is going in my 'physics engine' for The Probe :)

OT: So how are you coming with your game?

cheers,
Paul

WILL
09-04-2011, 06:38 PM
I would love to Jason, but:

a) I haven't got any flavour of Mac at all.
b) I haven't had any luck in trying to install Mac OSX inside of a virtual machine to be able to do tests, etc.

Well good news is that if you did get a good virtual machine to run Mac OS X in you'd be in luck as it's at most only $50. :) You could get a Mac Mini as a low-end Mac for porting and iOS development (should you go there eventually) but that is still an expense as I know it.

Maybe if you got someone to compile it for you? Will the game be freeware or shareware/commercial?

paul_nicholls
09-04-2011, 11:36 PM
Well good news is that if you did get a good virtual machine to run Mac OS X in you'd be in luck as it's at most only $50. :) You could get a Mac Mini as a low-end Mac for porting and iOS development (should you go there eventually) but that is still an expense as I know it.

Maybe if you got someone to compile it for you? Will the game be freeware or shareware/commercial?

I think the limiting factor with getting a virtual machine version of Mac OSX installing on my home machine is that the laptop doesn't have hardware virtulization technology built-in, and it seems that I need that to successfully do a VM :(

I probably won't ever be able to afford a real piece of Mac hardware unfortunately...unless I win Tattslotto ;)

I might make a limited free demo version, but I WAS hoping to make a little bit of money off The Probe when it is ready :D

cheers,
Paul

code_glitch
10-04-2011, 08:35 AM
heh, VT for virtual machines? No way dude. I have an SU4100 CULV with NO virtualization support at 1.2ghz and give vmware player a core to run XP and it runs sweet as a dream... Give it 2 and my ubuntu host goes WTF are doing but XP is like, this is a VM? I never noticed. I doubt it'll differ much with OS X. Also, I have a server with a D510 atom that virtualizes its servers (easier to manage ;) ) and I can get a triple core vista up no problems. Trust me, if your CPU is better that Pentium 3 or 4; just grab ubuntu, vmware and off you go. Now, I say ubuntu, because I find that Windows resource management can be a little 'iffy' at best when dealing with virtual machines. If you want performance, go for arch no doubt about it, but for usability I'd go ubuntu.

Might I add, the 'shady' sides of the internet that deal with trackers and sweden tend to have the Mac stuff available assuming you 'lost' your paid for copy. And although the Mac EULA says you can't virtualise Mac OS X; lets face it, I'm sure there are quite a few people that went to the store, got a $20 mac install cd and then installed it... Purely hypothetical of course, right? ;) (I hope I didn't step over the legal line for the forums, if so remove this bit but I did try and keep it legal)

paul_nicholls
10-04-2011, 11:26 AM
heh, VT for virtual machines? No way dude. I have an SU4100 CULV with NO virtualization support at 1.2ghz and give vmware player a core to run XP and it runs sweet as a dream... Give it 2 and my ubuntu host goes WTF are doing but XP is like, this is a VM? I never noticed. I doubt it'll differ much with OS X. Also, I have a server with a D510 atom that virtualizes its servers (easier to manage ;) ) and I can get a triple core vista up no problems. Trust me, if your CPU is better that Pentium 3 or 4; just grab ubuntu, vmware and off you go. Now, I say ubuntu, because I find that Windows resource management can be a little 'iffy' at best when dealing with virtual machines. If you want performance, go for arch no doubt about it, but for usability I'd go ubuntu.

Might I add, the 'shady' sides of the internet that deal with trackers and sweden tend to have the Mac stuff available assuming you 'lost' your paid for copy. And although the Mac EULA says you can't virtualise Mac OS X; lets face it, I'm sure there are quite a few people that went to the store, got a $20 mac install cd and then installed it... Purely hypothetical of course, right? ;) (I hope I didn't step over the legal line for the forums, if so remove this bit but I did try and keep it legal)

Hmm...interesting, I think I will give it another go trying to get Mac OSX working in a VM :)

cheers,
Paul

code_glitch
10-04-2011, 12:16 PM
I believe that virtualbox is the one that winges if you dont have VT support, but as far as I know vmware couldn't really care less; as long as you have a CPU, which I think most people do in their computers, it'll run.. You do have a cpu right?

Reminds me, I might have to have another go at that project. Initially I wanted to run it natively, but finding drivers for a CULV motherboard with switchable graphics is hard enough and in fact a definite failure on Mac. Vm and unity (if it works in mac) might be worth a shot.

paul_nicholls
10-04-2011, 10:22 PM
You do have a cpu right?

hahaha!! good one :D

cheers,
Paul

code_glitch
11-04-2011, 04:36 PM
Just checking, I have asked that question and got no as answer... In those cases, I doubt virtualization is recommended for many reasons. :D

dazappa
11-04-2011, 11:50 PM
I got OS X working in Virtual Box a long time ago, I wish I could remember how I did it. I know for sure that yeah it did require hardware virtualization support, which I didn't have until this laptop. Aside from that, it's quite unstable, slow, and doesn't have hardware acceleration, but what can you expect? I was able to install XCode, but the iPhone sim is very unhappy when I try to run it. FPC w/ Lazarus works and can compile, but as I have no experience with developing for Mac aside from this, I'm not sure if the test ZenGL app I compiled even runs on other Macs (as it doesn't in VB), and I don't know proper deployment practices either :P

Along with the no hardware acceleration thing; it's hard to judge real world performance when it won't run or runs slowly, but seeing as Macs now are pretty much on par with PCs, it's not so much of an issue.

paul_nicholls
11-04-2011, 11:54 PM
Thanks for your input dazappa :) I might try again using VMWare player...

cheers,
Paul

code_glitch
12-04-2011, 09:01 PM
Oh, almost forgot to mention: if you have a dedicated video card from ATI or nVidia, vmware uses that to make what I call 'emulated GMA on steroids' i mean, since when has an emulated intel card run a demo at 80fps? I think the main factor though is RAM... What system do you plan on testing this out with if I may ask?

paul_nicholls
12-04-2011, 10:46 PM
I have a laptop with 2GB ram (1.75GB after other stuff is installed), a 2GHz Sempron AMD chip, Vista Home Premium, and I am pretty sure I don't have a dedicated video card as it is a laptop.

This is all I can recall until I go home tonight LOL

cheers,
Paul

paul_nicholls
15-09-2011, 06:35 AM
OMG...an update! :D

I have been writing a new game engine in parallel to coding The Probe, and I am now using the same engine to power the game. This will hopefully allow me to create versions of The Probe for Windows, Linux, and maybe even Mac OSX with very little source code changes!

The game engine uses OpenGL for its graphics, and OpenAL for the sound.

I think I will switch the Windowing/input side of things over to use SDL (Simple Direct-media Layer) as this will make my life much easier, not having to code separate OS versions of these parts :)

I am quite excited about my progress so far - almost all the game's basic functionality is now ported to the new game engine, even some extra stuff that wasn't in the uploaded version.

Hopefully the SDL version runs as well as the dedicated Windows API version that I already have running LOL

Oh, and for fun, I have played around with a Boulder Dash I cave decoding routine in the game so I can play original boulder dash caves too, but to do that completely I will need to add Amoeba's, slime, magic walls, and in box/out boxes :D

http://img545.imageshack.us/img545/9968/screenshotnzf.png (http://imageshack.us/photo/my-images/545/screenshotnzf.png/)

cheers,
Paul

farcodev
17-09-2011, 01:18 AM
It's a cool progress, and i can imagine that'S a load of work :)

"I think I will switch the Windowing/input side of things over to use SDL (Simple Direct-media Layer) as this will make my life much easier, not having to code separate OS versions of these parts '"

Maybe perhaps one day a FireMonkey win32/64/OSX version ;) 8)

paul_nicholls
17-09-2011, 07:43 AM
Thanks for the support farcodev :)

After some stuffing about with Ubuntu (installing gdb, openal, and sdl), manually installing the new linux version of the library (libxeengine.so) in /user/lib, and some other source code tweeks, I have gotten The Probe prototype to work under Ubuntu now!!

I have to move the sound and other media files to somewhere the program can find them, so that bit doesn't work yet, but I get graphical output, and can move around just like in the Windows version :)

Unfortunately, I am only getting around 4 FPS :(

Any ideas?

cheers,
Paul

chronozphere
17-09-2011, 08:26 AM
Thanks for the support farcodev :)

After some stuffing about with Ubuntu (installing gdb, openal, and sdl), manually installing the new linux version of the library (libxeengine.so) in /user/lib, and some other source code tweeks, I have gotten The Probe prototype to work under Ubuntu now!!

I have to move the sound and other media files to somewhere the program can find them, so that bit doesn't work yet, but I get graphical output, and can move around just like in the Windows version :)

Unfortunately, I am only getting around 4 FPS :(

Any ideas?

cheers,
Paul

Ah good stuff :) Too bad about the low FPS. You deffo need a dedicated video-card. Don't you have a computer that has one? You could even virtualize ubuntu on it and try how it runs over there (Playing with virtualization myself lately ^^).

paul_nicholls
17-09-2011, 09:54 AM
Thanks for the advice Nathan, but my same program using SDL and OpenGL runs around 60FPS under windows....it is only in Ubuntu that it runs around 4FPS.

Apparently here:
http://www.pascalgamedevelopment.com/showthread.php?2889-Slowdown-on-Linux&highlight=ubuntu+slowdown

it says that I should change my desktop pixel res to 16 bits per pixel to speed things up...

But after reading this I did some more checking and found I didn't have a recommended Nvidia graphics driver installed in "Addtional Drivers" so I am installing that to see if it helps.

I have an Nvidia Geforce 8200M G card if you are wondering in this laptop :)

cheers,
Paul

chronozphere
17-09-2011, 09:59 AM
Ohh.. a 8200M should be pretty good. :)

And I thought you actually installed Ubuntu on your laptop, but you're virtualizing it allready haha. Yes, Make sure you have those additions, otherwise you can only use those standard VESA drivers which don't really do OpenGL.

paul_nicholls
17-09-2011, 10:50 AM
Ohh.. a 8200M should be pretty good. :)

And I thought you actually installed Ubuntu on your laptop, but you're virtualizing it allready haha. Yes, Make sure you have those additions, otherwise you can only use those standard VESA drivers which don't really do OpenGL.

LOL! Maybe I wasn't clear, but I HAVE installed Ubuntu on my laptop so I can boot into Vista or Ubuntu - very nice :)
I installed it in Windows as a normal windows program, and apparently I can uninstall it the same way in Windows!

It runs very smoothly too :)

Ok, after much stuffing around, I have installed (and activated) an Nvidia driver now in Ubuntu, and my game runs very fast now in Ubuntu...yay!

In fact all the sounds AND graphics stuff works too - the sound wasn't loading because of a 'Sfx' instead of a 'sfx' path case (darn Linux) issue LOL so that is now fixed Woo Hoo!!

Cross-platform goodness aplenty..I have done it at last BWAHAHAHA!!! :D

Only one issue now - the game-play is actually quicker than on windows for some reason - the timing is out, not sure why.

hmm...interesting, after locking the frame rate to 60 FPS with the sdltick.pas timer, it now runs the same speed as in windows :)

Anyway, I am finally a very happy camper...I have separate lazarus projects which use all the same code to produce a windows library or game, or linux library or game ;)

cheers,
Paul

paul_nicholls
17-09-2011, 11:02 AM
Here is a screen shot of the game running under Ubuntu!

http://img638.imageshack.us/img638/1332/theprobeunderubuntu.th.png (http://imageshack.us/photo/my-images/638/theprobeunderubuntu.png/)

cheers,
Paul

WILL
17-09-2011, 03:14 PM
Cool. :)

You know porting a game project to other platforms can be very time consuming and distracting. I've been trying to port some of my projects to Mac OS X using Stoney's tutorial he posted here: http://www.freeze-dev.com/2011/07/debugging-sdl-applications-with-lazarus-on-mac-os-x/ It ports over quite well, except for somehow my project has some issues with SDL. That however seems to be project specific.

Stoney uses this technique with all of his projects and is able to make games for Windows, OS X, Linux and possibly iOS at the same time. Perhaps it bares reading if you are interested in porting to OS X some time in the near future. I know it helped me with my porting for the most part.

paul_nicholls
17-09-2011, 09:33 PM
Thanks for the link Jason, some very handy stuff there :)

Question - does this code:

{$IFDEF DARWIN}
{$linkframework Cocoa}
{$linkframework SDL}
{$linkframework SDL_image}
{$linkframework SDL_mixer}
{$linkframework SDL_ttf}
{$linkframework SDL_net}
{$link libSDLmain.a}
{$ENDIF}

go in the project's .dpr/.lpr file?

Mind you, I won't be porting over to OS X any time soon - I don't know anyone with a Mac, or have any kind of Mac. I also haven't had any luck installing Mac OS X in a virtual machine to try things that way either...

I would love to though once my game is more complete :)

cheers,
Paul

WILL
18-09-2011, 04:34 AM
In a word "Yes."

Just put it at or near the top of you main program file so that it can link all of those allowing you to use them in OS X. You'll need to include those in the bundle as well of course.

paul_nicholls
18-09-2011, 09:24 AM
Thanks Jason :)

paul_nicholls
19-09-2011, 03:32 AM
Since I am using OpenAL for sound, I guess I would have to add in a similar bit of code for that?


{$linkframework OpenAL}

Or is it enought that I am using the library like so in my OpenAL unit?


unit xeEngine_openal;

{$I xeEngine_include.inc}

interface

const
{$if defined(windows)}
libopenal = 'openal32.dll';
{$elseif defined(unix)}
libopenal = 'libopenal.so';
libopenal0 = 'libopenal.so.0';
libopenal1 = 'libopenal.so.1';
{$elseif defined(darwin)}
libopenal = '/System/Library/Frameworks/OpenAL.framework/OpenAL';
{$ifend}

cheers,
Paul

Stoney
19-09-2011, 09:49 AM
You need to add both actually, but then you should be set for OpenAL on Mac OS X.

paul_nicholls
19-09-2011, 10:18 PM
Thanks Stoney :)

cheers,
Paul

paul_nicholls
22-09-2011, 05:22 AM
Nice! files2pas, a little project I wrote back in 2007, and then updated in 2009 :
http://www.pascalgamedevelopment.com/showthread.php?3913-files2pas-data-resource-creator&p=43270&viewfull=1#post43270

has been useful for The Probe - I have used it to embed my resources into the .exe file, and now they aren't floating around separately. Much cleaner now :D

cheers,
Paul

paul_nicholls
30-09-2011, 12:16 AM
I have updated my blog again with what I am up to with The Probe's progress :)

http://theprobegame.com

cheers,
Paul

paul_nicholls
05-10-2011, 05:05 AM
Hey all,
I now have most of my old shiny slick Immediate Mode GUI stuff ported over to my new cross-platform engine, and is now part of the engine itself, so I can do suff like so:


initialization

procedure TTheProbe.OnCreateResources(var aExecuting: boolean);
var
x,y : word;
sr : TSoundRequest;
i : Integer;
Resource : TMemoryStream;
ResourceName: AnsiString;
begin
...
if GetResourceByName('systemgui',ResourceName,Resourc e) then begin xeEngine.GUI.LoadGUIFromStream(Resource,xeColorKey ,True); Resource.Free; end;
...
xeEngine.GUI.ResetLastWidget;
...
end;


updating

procedure TTheProbe.OnUpdateFrame(aTimeSlice: single; var aExecuting: boolean);
var
t: Single;
begin
inherited;


...
xeEngine.GUI.Update(aTimeSlice);
...
end;


Rendering

var
RadioButtons: array[1..2] of Boolean = (True,False);
ActiveRadio : Integer = 1;
ShowGUI : Boolean = True;
avalue : Single = 50;


procedure TTheProbe.RenderTestGUI;
var
i: Integer;
y: Single;
h: Single;
begin
h := FFont.MaxHeight(1) + 4;
xeEngine.GUI.Prepare;
try
xeEngine.GUI.SetFontColor(xeEngine.MakeColor(255,2 55,255,255));
xeEngine.GUI.SetBackgroundColor(xeEngine.MakeColor (64,64,64,255));
xeEngine.GUI.StartWindow(100,100,285,150,'Video Options',FFont,True);


y := 8;


for i := 1 to High(RadioButtons) do
begin
if xeEngine.GUI.DoRadioButton(ActiveRadio = i,8,y,Format('radio button#%d',[i]),FFont) then
begin
ActiveRadio := i;
end;
y := y + h;
end;


if xeEngine.GUI.DoButton(8,60,75,30,'ok',FFont) then
begin
ShowGUI := False;
end;
y := y + 35;


xeEngine.GUI.DoLabel(8,y,'some trackbar',FFont,xeYellow,True);
y := y + h;


xeEngine.GUI.DoHorizontalTrackBar(8,y,100,0,100,av alue);


xeEngine.GUI.EndWindow;
finally
xeEngine.GUI.Finish;
end;
end;


which does this
http://img651.imageshack.us/img651/5384/imagepcs.png (http://imageshack.us/photo/my-images/651/imagepcs.png/)

And it just works :D

cheers,
Paul

code_glitch
09-10-2011, 11:39 AM
ooh, shiny indeed :)

paul_nicholls
09-10-2011, 09:28 PM
thanks mate :)

paul_nicholls
17-10-2011, 04:46 AM
Finally! I have now managed to make horizontal and vertical scroll bars with proportional thumb size, and page+document size.

I am using them in the WIP editor for The Probe :)

http://img405.imageshack.us/img405/3259/editorwip.png (http://imageshack.us/photo/my-images/405/editorwip.png/)

I can now edit a level, just not save, load, or test it yet! :D
I also can't create/edit links for teleporters, switches, and warps yet either...but it is a good start :)

cheers,
Paul

farcodev
21-10-2011, 02:37 PM
cool work, i see that you've included even layers on it o.O

paul_nicholls
21-10-2011, 11:47 PM
cool work, i see that you've included even layers on it o.O

Thanks mate :)
In The Probe the layers are like so:

Layer#0: warps, teleporters, travellators
Layer#1: TLS beam layer
Layer#2: main layer for player, walls, crystals, rocks, etc.
Layer#3: Acid

paul_nicholls
05-12-2011, 09:54 PM
I have finally gotten other stuff into my editor like working switches, teleporters, and travel tubes...

So, this means that I am just about ready to release a simple demo version of The Probe with some test levels so you guys can try it out...finally! <phew> :D

paul_nicholls
14-12-2011, 11:56 AM
Finally, I have uploaded a test version of The Probe to my DropBox folder:

http://dl.dropbox.com/u/1805932/TheProbe_Game.7z (2.46MB, Windows version only right now...Ubuntu version coming soon!)

Just unzip it to some location, it doesn't need installing.

If you don't get any sound, you need to install OpenAL...
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx

It includes a help file .pdf, and the executable even has various extra modes like an Editor mode, fullscreen mode, and stand-alone level mode!

Please read the help document first, and then try it.

The in-game menu doesn't have some options working so they are greyed out for now (load custom levels, help, and options).

Please give me some feed back as to what you think so far, and if you feel so inclined, even try making some levels using the editor so I can try them out. If the levels are good enough I might include them in the final game as one of the 'campaign' levels!

Enjoy!
Cheers,
Paul

SilverWarior
14-12-2011, 10:44 PM
I would like to try your game out, but can't start a new game. The reason is a bit strange keybord hardware configuration of my laptop. Both Enter keys are acts as NumpadEnter (the only drawback of my laptop).
So it would be nice if you add support to use both Enter keys (VK_RETURN and VK_ENTER) for Executing menu commands.
Another thing that bothers me is the fact that you hide mouse cursor when user moves mouse pointer over the game windows, but don't handle any cursor drawing by yourself. So my cursor just disapears and I don't know where it is. Yes I do understand that in some situations this is neccesary, but I realy don't see need for this in the main menu.

paul_nicholls
14-12-2011, 11:48 PM
Hi SilverWarior,
thanks for the report of the issues :)

I will add in support for KEY_KP_ENTER (my internal numberpad enter key) so you should be able to use the menu.
With regards to the cursor issue, did you want me to make the cursor appear in the menu at all times, but not in-game?

BTW, the menu will sometimes have GUI controls appearing that you can click with the cursor, and in these times the cursor will appear then.

cheers,
Paul

SilverWarior
15-12-2011, 01:58 AM
With regards to the cursor issue, did you want me to make the cursor appear in the menu at all times, but not in-game?

Yes that's the idea. I do know that if you target other platforms it isn't posible to use cursor on all of them but when we talk about PC's having a mouse cursor is almost standard. You do know that for end user it is much easier to use mouse for executing menu actions than scroling through all menu items to get to the one you want.

And I don't hate disapering mouse cursor becouse this way I need to scrool trough the menu but I do hate it becouse in some cases knowing where the mouse cursor is very helpful. For instance let's say that your game has some bug and fires Access Violation Message. If you want to close that message you need to click on OK button of that message. So if youd don't know where the cursor is you will have hard time moving it into the Message Window to actually clik on OK button. Yes in most ocasions pressing Enter or space would have same effect but not always.
Once I even had a development version of some game wich was using the worst posible example for hiding cursor. The game actualy changed systemwide seting for default mouse cursor to use a cursor template where all posible pictures of cursor were just blank. So when the game crashed I ended up with Windows wich had no visible mouse cursor, even after the system restart. Luckly I quickly figured out why and fix it (I can do any operation in Windows without even using a mouse, but it does takes more time).
So that's why I try to avoid hiding mouse cursor until it is compleetly neccesary. In one off my currently discarded projects (it is discarded becouse of lack off neccesary knowledge) I even wrote a rutine wich took care that mouse cursor always showed if some exception was fired. The only drawback was that my rutine didn't notify me off what exception was fired in the first place. This was some time ago when my programing skils were a lot weaker. Today I would probably write it in a different way but stil geting the same effect.

paul_nicholls
15-12-2011, 03:08 AM
Ok, cool :)

Well, I have made the cursor drawn when in menu mode (and showing GUIs), but not while playing the game.

I have also added in support for the keypad Enter key - it seems to work on my standard keyboard when I hit that key in the menu, so hopefully it will work on yours!

I have done some other changes/fixes too (written in an extra changes txt file), and am now displaying a version in The Probe for debugging purposes so people can refer to the version :)

I will try and add in an options GUI to control the sfx/music volume, etc. before releasing the new version tonight, but if I don't have time I will upload it as is so you can try it out...

Thanks again for your input mate!

cheers,
Paul

paul_nicholls
15-12-2011, 11:28 AM
Here is the latest version:

http://dl.dropbox.com/u/1805932/TheProbe_Game_%28v2011.12.15%29.7z (2.82MB, Win32)

and the change log details for this version:



Version: 2011.12.15
* Change - Added in support for numberpad enter key with menus.
* Change - Made cursor always appear when in menu mode.
* Change - Displays version number in game to help debugging issues.
* Change - Added game controller support with menus (up, down, fire).
* Change - Updated "The Probe_Help.pdf" to include extra in-game controls and editor todo list.
* Fix - Stopped TLS beam and other things updating when doors opening/closing.
* Fix - Changed when doors can open/close so they operate at the correct times.
* Fix - Fixed bug when game mode didn't go to "player dead" when player killed by acid.
* Fix - Fixed bug when teleported player's health became 100%

Enjoy :)

cheers,
Paul

SilverWarior
15-12-2011, 01:37 PM
I do have another keys relation suggestion. Currently you use arow keys and enter in menu and WASD keys and space ingame. Why not use the same keys both in menu and in the game. Or even better why not use both in menu. Having the ability to change controls would also be verry good.
As for the mouse cursor do hide the ingame cursor when mouse leaves the game window and show it again when the mouse enters the game window. You do this by using OnMouseEnter and OnMouseLeve events.
Also having the mouse controll in the menu won't be bad.
Why not also include option for multiplayer COOP play. You just need to add another probe for other player and make some level suitable for COOP play, where both players need to cooperate to finish the level. This would definitly make the game much better.
Currently you simly use one power source for powering the teleporter. Why not make the game so that you might even need to use combination of multiple power sources for sucsesfully powering the teleorter. This would definitly come in handy if you decide to do include COOP play.

Theese are my suggestions for now.
I will go and play with the editor some time later today so maybe I'll have even more suggestions later.
I might even try to make a level suitable for COOP play.

paul_nicholls
15-12-2011, 07:54 PM
I do have another keys relation suggestion. Currently you use arow keys and enter in menu and WASD keys and space ingame. Why not use the same keys both in menu and in the game. Or even better why not use both in menu. Having the ability to change controls would also be verry good.

Thanks for the control thoughts :)
I think I WILL make the menu use both lots of keys too, that will make things more intuitive...

Control customization will be added back into the game ASAP like I had in the previous version on my website.


As for the mouse cursor do hide the ingame cursor when mouse leaves the game window and show it again when the mouse enters the game window. You do this by using OnMouseEnter and OnMouseLeve events.
Also having the mouse controll in the menu won't be bad.

I am doing this in the game now (at least emulating it)...I am hiding the cursor completely all the time when over the window, but rendering it manually at the appropriate times :)


Why not also include option for multiplayer COOP play. You just need to add another probe for other player and make some level suitable for COOP play, where both players need to cooperate to finish the level. This would definitly make the game much better.

hmm...interesting idea, not sure if I will implement it, but I might try it out. I had never thought of doing COOP play in The Probe since the original game and other 'clones' and variations don't either (AFAIK) :)


Currently you simly use one power source for powering the teleporter. Why not make the game so that you might even need to use combination of multiple power sources for sucsesfully powering the teleorter. This would definitly come in handy if you decide to do include COOP play.

What sort of multiple power sources would you suggest? Otherwise I could just make it so each Probe can only get some of the crystals in a level, so the COOP play would be required to complete it :)


Theese are my suggestions for now.
I will go and play with the editor some time later today so maybe I'll have even more suggestions later.
I might even try to make a level suitable for COOP play.

I know the editor is lacking some features yet, but some are on my TODO list (in the .pdf help file)...feel free to feedback any other issues :)

Thanks so much for all the feedback mate!

cheers,
Paul

SilverWarior
16-12-2011, 12:37 AM
I am doing this in the game now (at least emulating it)...I am hiding the cursor completely all the time when over the window, but rendering it manually at the appropriate times :)

Yes I know that. What I was refering to is that you stop renderning ingame cursor when the mouse cursor leaves the window. This way you don't have ingame cursor left on the last position when the mouse cursor left the windows (both ingame and windows default cursor are seen at the same time)


hmm...interesting idea, not sure if I will implement it, but I might try it out. I had never thought of doing COOP play in The Probe since the original game and other 'clones' and variations don't either (AFAIK) :)

Adding new fetures to the game usualy increases the game value (offcourse if theese fetures are implemented correctly). I'm sure that you won't mind if your game would have bigger value than original and clones had.


What sort of multiple power sources would you suggest? Otherwise I could just make it so each Probe can only get some of the crystals in a level, so the COOP play would be required to complete it :)

I was thinking of having two or more power sources on different places in the level. So for sucsesfuly powering the teleporter user has to chanel power from all off theese power sources to the teleporter at the same time (mutiple beams) .
As for COOP play I was thinking off having levels where each player spawns in different part of the level, and isn't able to rach the part where the other player spawned in. Or maybe levels which are designed in a way that one player need to flip one swich so the other player may get from one place to another.
Maybe you could either include temporary swithces which turn of some time after they have been turned on.

This would all add a lot to the game depth and thus making the game much more intesresting.

PS: I also found two bugs.
1. When you turn off the switch the telepad or whatever was turned on in the first place stays on.
2. After the game over (you lose all off your lifes) if you start a new game you end up with no ditional lifes (game over after first death)

paul_nicholls
16-12-2011, 01:04 AM
Yes I know that. What I was refering to is that you stop renderning ingame cursor when the mouse cursor leaves the window. This way you don't have ingame cursor left on the last position when the mouse cursor left the windows (both ingame and windows default cursor are seen at the same time)

Ah, ok...I misunderstood what you wrote earlier. Not sure how I can fix this as I am using SDL to manage the window, and I don't know if there is a mouse enter/leave for that.

I will look into it, and if I can't fix it, I might have to get rid of my custom mouse cursor, and just show/hide the normal cursor so there is only one either inside the window, or outside the window.


Adding new fetures to the game usualy increases the game value (offcourse if theese fetures are implemented correctly). I'm sure that you won't mind if your game would have bigger value than original and clones had.

Of course! It just wasn't in my original vision of The Probe, but I will think on this :)


I was thinking of having two or more power sources on different places in the level. So for sucsesfuly powering the teleporter user has to chanel power from all off theese power sources to the teleporter at the same time (mutiple beams).

hmm...interesting idea, again I will think on this :)


As for COOP play I was thinking off having levels where each player spawns in different part of the level, and isn't able to rach the part where the other player spawned in. Or maybe levels which are designed in a way that one player need to flip one swich so the other player may get from one place to another.
Maybe you could either include temporary swithces which turn of some time after they have been turned on.

Thanks for the ideas...I will digest and think on it :)


This would all add a lot to the game depth and thus making the game much more intesresting.

It could, at that ;)


PS: I also found two bugs.
1. When you turn off the switch the telepad or whatever was turned on in the first place stays on.
2. After the game over (you lose all off your lifes) if you start a new game you end up with no ditional lifes (game over after first death)

Ok, 1 is not a bug, I just did it that way...I can make it toggle the state of the object when it is clicked on/off if you really want.
PS. I was going to add in different types of actions, like the current one (on and not off), or on/off when turned on/off, and maybe other ones, but I only have the one action type ATM...

Ow! 2 is definitely a bug, thanks for picking that one up...I will fix that right away!

cheers,
Paul

paul_nicholls
16-12-2011, 03:23 AM
Hopefully some other people besides you SilverWarior can try The Probe :D
More feedback, the merrier ;)

SilverWarior
16-12-2011, 05:39 AM
I will look into it, and if I can't fix it, I might have to get rid of my custom mouse cursor, and just show/hide the normal cursor so there is only one either inside the window, or outside the window.

It is deffinitly posible. If there is no other way you can always intercept Window messages by yourself (atleast on windows platform, not sure for the others)

paul_nicholls
19-12-2011, 05:09 AM
It is deffinitly posible. If there is no other way you can always intercept Window messages by yourself (atleast on windows platform, not sure for the others)

I will look into it, thanks :)

paul_nicholls
05-01-2012, 01:01 AM
Hi all,
I have got another update of The Probe uploaded to my dropbox folder :)

I apologize for the much larger size of the download, it now has in-game music (woo hoo!...thanks Safrosoft!), and I can't yet play compressed audio formats in my engine...this is on my TODO list!

http://dl.dropbox.com/u/1805932/TheProbe_Game_Win32%20%28v2012.01.05%29.7z (14.6MB, 7-zip file)

Here is the change log:


Version: 2012.01.05
* Change - Added control and audio configuration menus & dialogs. This includes hearing music & sfx when adjusting their respective volumes.
* Change - Default game movement controls are now the cursor keys due to high demand.
* Change - Added in-game music (woo hoo!).
* Change - Configuration is saved to /loaded from .ini file in game folder.
* Change - Updated "The Probe_Help.pdf" to reflect latest game changes like controls.
* Change - Added sound effects for TLS charging (10% - 90% in steps of 10%).
* Fix - Fixed bug where lives not set to default amount when doing new game.
* Fix - Fixed bug where level updates before doors open and not in game mode.
* TODO - Allow reading of compressed audio files to reduce game executable size. There is too much bloating right now due to the uncompressed music size.



Enjoy!

cheers,
Paul

paul_nicholls
05-01-2012, 07:53 PM
bump! :D
I hope all of you have had some very nice holidays so far?

SilverWarior
06-01-2012, 11:07 AM
There is a bug in editor. Ingame cursor is always drawn on one place (doesn't move).
I also recomend changing TLS charging sound effects. It would be much better if you use some buzz loop sound and then you just change its buzzing frequency (lower the charge lower the frequency). This could also enable you to easily update sound for every percent of charge.

paul_nicholls
06-01-2012, 12:28 PM
There is a bug in editor. Ingame cursor is always drawn on one place (doesn't move).

Damn it! I know that I had fixed it, but in my current code base the bug was still there...I must have fixed it and not committed the changes or something and lost it :(
My apologies about that! I will upload a new version ASAP... :-[


I also recomend changing TLS charging sound effects. It would be much better if you use some buzz loop sound and then you just change its buzzing frequency (lower the charge lower the frequency). This could also enable you to easily update sound for every percent of charge.

Ok, noted...I will see if I can do something like you are saying :)

Thanks for the feedback mate! Much appreciated...and sorry again about the editor bug :(

cheers,
Paul

paul_nicholls
15-01-2012, 07:56 PM
Hey all,
I have a problem with some song playing code in my game...it uses a thread to play a .mod or .xm tracker module in the background. It works perfectly under windows, but when I run it under Ubuntu 10.04 I get this error:

http://img163.imageshack.us/img163/8604/screenshotdebuggererror.png (http://imageshack.us/photo/my-images/163/screenshotdebuggererror.png/)

Any ideas?

EDIT: I didn't write the code, but I was hoping I could fix it so I don't have to bother the author of the code :)

cheers,
Paul

paul_nicholls
16-01-2012, 07:41 PM
Anyone have any ideas about this error? Until it is fixed I can't make a linux version of The Probe...

SilverWarior
16-01-2012, 08:17 PM
You might be able to find some more info on the problem here: http://www.opensubscriber.com/message/fpc-devel@lists.freepascal.org/12907559.html

paul_nicholls
16-01-2012, 09:15 PM
Thanks SilverWarior...I did do a google before, but didn't find that particular page before...I will have a read :)

paul_nicholls
17-01-2012, 01:19 AM
hmm...I don't think the link helped me very much unfortunately...

SilverWarior
17-01-2012, 10:57 AM
I found this page on FPC bug tracker wich actually describes similar if not the same problem. I hope it will be more helpful for you.
http://bugs.freepascal.org/view.php?id=8623

Andru
17-01-2012, 11:14 AM
Without any line of code I can't say anything. Maybe you forgot to use unit cthreads?

User137
17-01-2012, 01:54 PM
What happens if you run the code without debugger?

paul_nicholls
17-01-2012, 07:46 PM
@SilverWarior: Thanks for the link, some interesting stuff there...
@Andru: I will hopefully be able to put the code online tonight.
@User137:hmm...not sure, I will have to try tonight...I have to go to work soon and I am running windows ATM not Ubuntu (need to reboot my laptop)

cheers,
Paul

paul_nicholls
18-01-2012, 08:45 AM
@User137: So how do I run without the debugger in Lazarus(0.9.31, Ubuntu...)? I can't see an option, unless I am going blind! haha If I run the 'executable' directly from a window in Ubuntu then nothing seems to happen (I guess due to the error).
@Andru: I have attached the music playing unit here: 692
If someone wants to use it, I would probably ask BeRo to make sure as that is the polite thing to do, especially if your project is a commercial one!! :)

I hope someone can find the threads bug, as that is the only thing holding me back now from releasing a Linux version!! :D

PS. The code is more complex and larger that it needs to be if you only want Win/Linux support...it also has compile defines and code for WinCE (which I am never going to use anyway...)

cheers,
Paul

Andru
18-01-2012, 09:08 AM
Oh, I thought you have your own thread. Trying to find a bug(or maybe this is not a bug) inside BeRoXM will take much time, so...

paul_nicholls
18-01-2012, 09:18 AM
Oh, I thought you have your own thread. Trying to find a bug(or maybe this is not a bug) inside BeRoXM will take much time, so...

I thought as much, so I can easily go on with updating the windows version which will automatically update the linux version too :D

No rush...

cheers,
Paul

paul_nicholls
18-01-2012, 09:54 AM
Actually, I did have one question about trying to debug the music playing code...how can I debug a .so file that I have compiled under Linux using Lazarus anyhow?

I have been copying over the library .so file into the /usr/lib folder using a script (in sudo mode) so that Ubuntu can find it when I run The Probe. Unfortunately this means I can't debug and put in breakpoints into the code as I can't compile it using Lazarus into the /usr/lib folder directly, and if I leave it in the same folder as the game executable then Ubuntu can't find the .so file to load it :(

Quite frankly, I am stumped...

Any ideas?

cheers,
Paul

paul_nicholls
18-01-2012, 10:34 AM
I have gotten a breakthrough!! I still can't debug a ".so" file (would be nice...), but now I don't get the thread crash anymore :)

I had to add

{$ifdef linux}
cthreads,
{$endif}

to both my project using the ".so" library file, and the library file itself, not just using cthreads in the BeRoXM code!!

I don't get any music still for some reason, but I don't get the crash anymore...yay!

I still would love to know how to debug a ".so" library file though :D

EDIT: hmm...it seems that I can step into the library from my main program just like in Delphi, so that really helps :)

cheers,
Paul

User137
18-01-2012, 10:49 AM
@User137: So how do I run without the debugger in Lazarus(0.9.31, Ubuntu...)? I can't see an option, unless I am going blind! haha If I run the 'executable' directly from a window in Ubuntu then nothing seems to happen (I guess due to the error).
Well, running the execautable directly is the same thing, although not done through Lazarus. It is useful sometimes so this is how:
in Lazarus Tools menu -> Options ...
-> Debugger -> Debugger type = (none)

paul_nicholls
18-01-2012, 07:34 PM
Well, running the execautable directly is the same thing, although not done through Lazarus. It is useful sometimes so this is how:
in Lazarus Tools menu -> Options ...
-> Debugger -> Debugger type = (none)

Ok, that makes sense :)

paul_nicholls
24-01-2012, 11:08 PM
Hi all,
I have uploaded the latest version of The Probe to it's dedicated website now (scary!!) :D
http://theprobegame.com/

See the downloads page to get it ;)

Here is the latest change log:

Version: 2012.01.25
* Change - Added module music (.xm, .mod) playing code to reduce game footprint size (Thanks BeRo!).
* Change - Added module music tracks into game; one for the menu and the rest for in-game levels.
* Change - Added scrolling credits to bottom of menu screens.
* Change - Change default fire key from SPACE to Left-CTRL key due to user request.
* Change - In-game music now starts playing after player teleports into a level, and plays a random track each new level (track restarts when level restars).
* Change - Renamed 'options' menu item.
* Change - Editor Mode: Added W,S,A,D keys to scroll level (independant of scroll bars) to allow clicking outside level boarders to expand level size automatically.
* Change - Editor Mode: Added Space, 'X', 'Y' keys to rotate and flip (where applicable) the selected tile.
* Change - Updated switch graphics to much nicer ones!
* Change - Updated "The Probe_Help.pdf" with Background Story, game objective, and new fire key, new switch graphics and new editor information.
* Change - Added some more test levels to the main game for users to try out.
* Fix - Fixed editor bug where cursor not moving (thanks SilverWarior)!

Here is a challenge: Now that the editor is working again, and is more user friendly (I believe)...it would be great if you guys could try making some levels if you get time :)
When done, can you send them to me, or post them here?
If I like them good enough I will add them into the game itself!

cheers,
Paul

SilverWarior
25-01-2012, 01:15 PM
Again I found several bugs:
1. In audio options menu you can move your selection down, but you can't move it up (UP key not responding).
2. In audio options it is not posible to use enter for checking or unchecking the checkboxes or for presing butons.
3. When you are returned to the main menu after death the ingame music doesnt stop so you got both ingame music and menu music playing at the same time.
4. For some reason my probe won't fire, so I cant get past level 3. Or should I always run around?
5. After geting on travelators it is almost imposible to get off. Is this how it is suposed to be?
6. When working with editor it is posible to start (test ) a level without probe in it. You should add a safety check to se if probe was placed anywhere in the level before alowing to proceed.

I'm I the only bug hunter in your game? ??? Or is it just that I find them before others do? ;D

Some feture requests:
1. Add ability to chose wich level you want to load.
2. Add ability to chose the desired filename when saving level.
3. Make editor available from games main menu (only when there is no current active game)
4. Another great feture will be ability for players to be able to do their own campaigns (series of levels joined into special file). I belive this will atract more pepole.

That's it for now.

paul_nicholls
25-01-2012, 09:03 PM
Again I found several bugs:
1. In audio options menu you can move your selection down, but you can't move it up (UP key not responding).
2. In audio options it is not posible to use enter for checking or unchecking the checkboxes or for presing butons.
3. When you are returned to the main menu after death the ingame music doesnt stop so you got both ingame music and menu music playing at the same time.
4. For some reason my probe won't fire, so I cant get past level 3. Or should I always run around?
5. After geting on travelators it is almost imposible to get off. Is this how it is suposed to be?
6. When working with editor it is posible to start (test ) a level without probe in it. You should add a safety check to se if probe was placed anywhere in the level before alowing to proceed.

1. Bug Confirmed! I am sure that worked ages ago...I must have broken it at some point :( I usually don't use the keys to control the GUI so this one slipped past. Thanks for finding it :)
2. The enter key triggers buttons only, not check boxes (and works for me just fine), and space works for check boxes/radio buttons - again this is working fine right now for me.
Hmm...are you trying the main enter key? The keypad keys don't work with the GUI at this point in time...
3. Another confirmed! I obviously didn't try going back to the menu using fire since I added the music! I will fix this one too...
4. Hmm...I have never had this issue before. Again, are you trying to use the keypad keys (or equivalent)? This might explain the firing not working...what fire key are you using, and have you tried reconfiguring to another key?
PS, you don't need the fire key in the third level anyway...just keep moving around :)
5. Yes, that is how travellators work in the game at this time.
6. I know this one, but since it doesn't break the game or cause crashes, and the player just can't move, I left it how it was :) Maybe I might change it later.


I'm I the only bug hunter in your game? ??? Or is it just that I find them before others do? ;D

Some feture requests:
1. Add ability to chose wich level you want to load.
2. Add ability to chose the desired filename when saving level.
3. Make editor available from games main menu (only when there is no current active game)
4. Another great feture will be ability for players to be able to do their own campaigns (series of levels joined into special file). I belive this will atract more pepole.

That's it for now.

1. I want to add this feature in but I wasn't quite sure how to do this...have the user enter some level code, or click on a level GUI selection to run it?
2. I am having trouble making a GUI text box ATM so I can't do this yet...unless I make a GUI with characters on it like an arcade game when entering your name?
3. I am going to do this at some point :)
4. I was planning on including my level packer program with the game so people can make level pack files (a campaign?) so other users can play the combined levels too as well as single levels :)

It seems you are the only one testing (or at least reporting on my game)! :(

Thanks so much for all the feedback so far, I will fix the issues you have addressed and I am always trying to improve The Probe :)
EDIT: Besides the bugs, how do you like The Probe so far? ;)

cheers,
Paul

SilverWarior
25-01-2012, 10:40 PM
Hmm...are you trying the main enter key? The keypad keys don't work with the GUI at this point in time...

Unfortunatly I have one of those laptops where both enter keys act as a NumpadEnter (hardware isue), so the problem lies on my part.


Hmm...I have never had this issue before. Again, are you trying to use the keypad keys (or equivalent)? This might explain the firing not working...what fire key are you using, and have you tried reconfiguring to another key?

I tried reconfiguring my keys. No luck?


I want to add this feature in but I wasn't quite sure how to do this...have the user enter some level code, or click on a level GUI selection to run it?

I see you didn't understand me correctly. I was talking about the Editor.


I am having trouble making a GUI text box ATM so I can't do this yet...unless I make a GUI with characters on it like an arcade game when entering your name?

That could be nice idea. Actualy I think that having the whole GUI made in game theme would look very nice. Currently I'm stil busy writing my article, but when I finish it I will prbably look into SDL graphics, so maybe I might be able to help you with the GUI.

After giving some thought about curent and past bugs that I managed to find in The Probe I suspect that you have bad overal code structure of your game. I might be wrong. If it isn't a secret can you tell me what's the basic structure of your code.


Besides the bugs, how do you like The Probe so far?

It seems preety nice especialy now with music. I like the ingame music a lot, very energetic.
Also I see a lot of potential in this game. That is probably the main rason why I'm so eager in monitoring its progress.
To be honest I'm monitoring progress of many games. Belive it or not by doing so you can learn a lot about the game mechanics even without seing a single line of source code.

Anyway keep up the good work!

paul_nicholls
26-01-2012, 10:01 PM
Unfortunatly I have one of those laptops where both enter keys act as a NumpadEnter (hardware isue), so the problem lies on my part.

Bummer...I will see what I can do about that on my end :)


I tried reconfiguring my keys. No luck?

Unfortunately, I don't know how to help you on this one :( Do you have a game controller (joystick, game pad, etc.) that you can try instead?
If you do, plug it in before running the game...


I see you didn't understand me correctly. I was talking about the Editor.
Ah, ok LOL Well I will see if I can make the editor load up a user requested file from in the editor itself instead of via the command line as it currently is :)


That could be nice idea. Actualy I think that having the whole GUI made in game theme would look very nice. Currently I'm stil busy writing my article, but when I finish it I will prbably look into SDL graphics, so maybe I might be able to help you with the GUI.
Thanks for the offer...in the meanwhile I will see what I can do about a replacement GUI instead of the text box :)


After giving some thought about curent and past bugs that I managed to find in The Probe I suspect that you have bad overal code structure of your game. I might be wrong. If it isn't a secret can you tell me what's the basic structure of your code.
erm, yes, well...:-[ I do admit that some of the code in the main project .dpr file is a bit messy and could use refactoring, like separate methods for different states...that would make things easier to fix bugs and stuff during different game states :D

Currently I am doing different things in the RenderMethod, UpdateFrame, and UpdateInput methods depending on the game states, but all that code is mixed in together and not separated into different routines, so it is too easy for bugs to slip in as it is...

OnUpdateFrame method:

procedure TTheProbe.OnUpdateFrame(aTimeSlice: single; var aExecuting: boolean);var
t: Single;
begin
inherited;


FTimeSlice := aTimeSlice;


if FGameMode in [gmGamePlaying,gmGameLevelComplete] then
FPlayingGame := True
else
FPlayingGame := False;


if Assigned(FResumeGameItem) then
FResumeGameItem.Enabled := (FGameMode = gmMenu) and (FLastGameMode <> gmNone);


if FDoors.Status = cDoors_Closed then
// change mode depending on game mode
begin
if FGameMode = gmMenu then
begin
if Assigned(FMenuMusic) then FMenuMusic.Pause;
FGameMode := FLastGameMode;
FDoors.Status := cDoors_Opening;
SetDoorsMinWidth(cPlayingModeDoorsWidth);
end
else
if FGameMode <> gmMenu then
begin
FLastGameMode := FGameMode;
if FLives = 0 then
FLastGameMode := gmNone;


FGameMode := gmMenu;


if FConfiguration.MusicEnabled then
if Assigned(FMenuMusic) then FMenuMusic.Resume;


FDoors.Status := cDoors_Opening;
ResetCredits;
SetDoorsMinWidth(cMenuModeDoorsWidth);
end
end
else
if (FGameMode = gmMenu) and Assigned(FActiveMenu) then
begin
UpdateCredits;
end;


FProbeEngine.EditorMode := FShowEditorGUI;
FProbeEngine.UpdateTLSBeam := (FDoors.Status = cDoors_Open) and (FGameMode = gmGamePlaying);


if not FShowEditorGUI then
begin
if (FDoors.Status = cDoors_Open) and (FGameMode <> gmMenu) then
FProbeEngine.Update(aTimeSlice);
end;


if FShowEditorGUI or Assigned(FRenderActiveGUI) then
xeEngine.GUI.Update(aTimeSlice);


PlayRequestedSounds;


FProbeAnimateCount := FProbeAnimateCount + aTimeSlice;
if FProbeAnimateCount >= cProbeAnimateRate then
begin
Inc(FProbeIndex,FProbeIndexDelta);


if (FProbeIndex = 3) and (FProbeIndexDelta = 1) then
FProbeIndexDelta := -1
else
if (FProbeIndex = 1) and (FProbeIndexDelta = -1) then
FProbeIndexDelta := 1;


FProbeAnimateCount := 0;
end;


FAnimateCount := FAnimateCount + aTimeSlice;
if FAnimateCount >= cAnimateRate then
begin
Inc(FTravellatorIndex);
if FTravellatorIndex > 3 then FTravellatorIndex := 1;
FAnimateCount := 0;
end;


if (FDoors.Status = cDoors_Open) and (FPlayerData.PlayerMode = pmNormal) and (FGameMode = gmGameLevelComplete) and (FLevelCompleteTimer > 0) then
begin
FLevelCompleteTimer := FLevelCompleteTimer - FTimeSlice;
if FLevelCompleteTimer <= 0 then FLevelCompleteTimer := 0;
end;


if (FDoors.Status = cDoors_Open) and (FGameMode = gmGamePlaying) then
begin
if FPlayerData.PlayerMode <> pmNormal then
begin
if FPlayerData.PlayerMode = pmTeleportingIn then
begin
if FTeleportInDelay <= 0 then
begin
FPlayerData.TeleportCount := FPlayerData.TeleportCount + FTimeSlice;


if FPlayerData.TeleportCount >= cTeleportTime then
begin
FPlayerData.TeleportCount := cTeleportTime;
FPlayerData.PlayerMode := pmNormal;


if FConfiguration.MusicEnabled then
if Assigned(FGameMusic) then FGameMusic.Play(FConfiguration.MusicVolume,True);
end;
end
else
begin
FTeleportInDelay := FTeleportInDelay - FTimeSlice;


if not FShowEditorGUI and (FTeleportInDelay <= 0) and FConfiguration.SfxEnabled then
FTeleportLevel.Play(FConfiguration.SfxVolume * 0.5);
end;
end
else
if FPlayerData.PlayerMode = pmTeleportingOut then
begin
FPlayerData.TeleportCount := FPlayerData.TeleportCount - FTimeSlice;


if FPlayerData.TeleportCount <= 0 then
begin
FPlayerData.TeleportCount := 0;
FPlayerData.PlayerMode := pmNormal;
FGameMode := gmGameLevelComplete;
end;
end;
end
else
if FTLSData.Charge >= 100 then
begin
FLevelCompleteTimer := 16 * FProbeEngine.UpdateRate;
FPlayerData.TeleportCount := cTeleportTime;
FPlayerData.PlayerMode := pmTeleportingOut;
if Assigned(FPlayerData.PlayerObj) then
FPlayerData.PlayerObj^.Value := cObjPostProbe;


// stop any player movement from before
FProbeEngine.MoveUp := False;
FProbeEngine.MoveDown := False;
FProbeEngine.MoveLeft := False;
FProbeEngine.MoveRight := False;
FProbeEngine.Firing := False;


if not FShowEditorGUI and FConfiguration.SfxEnabled then
FTeleportLevel.Play(FConfiguration.SfxVolume * 0.5);
end;
end;


UpdateDoors;


if xeEngine.Window.KeyIsHit(KEY_ESCAPE) then
begin
if Assigned(FRenderActiveGUI) then
// deactivate current GUI
ActivateGUI(nil);


if FEditorEnabled or FSingleLevelMode then
aExecuting := False
else
if not FUpdatingControl and (FDoors.Status = cDoors_Open) then
begin
if (FGameMode = gmMenu) and (FLastGameMode <> gmNone) then
FDoors.Status := cDoors_Closing
else
if (FGameMode <> gmMenu) then
begin
FDoors.Status := cDoors_Closing;


// pause playing game music
if Assigned(FGameMusic) then FGameMusic.Pause;
end;
end;
end;


FSentryCount := FSentryCount + aTimeSlice;
if FSentryCount >= cSentryAnimateRate then
begin
Inc(FSentryIndex);
if FSentryIndex > 2 then FSentryIndex := 1;
FSentryCount := 0;
end;


FTeleporterCount := FTeleporterCount + aTimeSlice;
if FTeleporterCount >= cTeleporterAnimateRate then
begin
Dec(FTeleporterIndex);
if FTeleporterIndex < 0 then FTeleporterIndex := High(FTeleporterId[True]);
FTeleporterCount := 0;
end;


FVortexAngle := FVortexAngle + cVortexRotationRate * aTimeSlice;
if FVortexAngle >= 360 then FVortexAngle := FVortexAngle - 360;


if not FShowEditorGUI and (FGameMode = gmGamePlaying) then
begin
FPlayerData.Health := 0;
if FProbeEngine.GetPlayerData(FPlayerData.PlayerFound ,FPlayerData.x,FPlayerData.y,FPlayerData.Position, FPlayerData.Health,FPlayerData.PlayerObj) then
begin
FOffsetX := Trunc(FScreenWidth / 2 - FPlayerData.x);
FOffsetY := Trunc(FScreenHeight / 2 - FPlayerData.y);
FProbeEngine.UseViewPort := True;
FProbeEngine.SetViewPort(Trunc(FPlayerData.x - cGameViewPortW/2),Trunc(FPlayerData.y - cGameViewPortH/2),cGameViewPortW,cGameViewPortH);
end;


FProbeEngine.GetTLSData(FTLSData.Emitter,FTLSData. EmitterPos,FTLSData.Charge);


if (FDoors.Status = cDoors_Open) and (FPlayerData.PlayerMode = pmNormal) and (FGameMode = gmGamePlaying) then
begin
FTimeCount := FTimeCount + aTimeSlice;
if FTimeCount >= 1 then
begin
FTimeCount := 0;
Inc(FTime.Seconds);


if FTime.Seconds >= 60 then
begin
FTime.Seconds := 0;
Inc(FTime.Minutes);


if FTime.Minutes >= 60 then
begin
FTime.Minutes := 0;
Inc(FTime.Hours);
end;
end;
end;
end;
end
else
FProbeEngine.UseViewPort := False;


FFlashingTimer := FFlashingTimer + 10 * aTimeSlice;
If FFlashingTimer >= 360 Then FFlashingTimer := FFlashingTimer - 360;


t := Sin(FFlashingTimer)/2 + 0.5;
FFlashingAlpha := Trunc(255 * (0.4 + (1 - 0.4) * t));
end;


It seems preety nice especialy now with music. I like the ingame music a lot, very energetic.
Also I see a lot of potential in this game. That is probably the main rason why I'm so eager in monitoring its progress.
To be honest I'm monitoring progress of many games. Belive it or not by doing so you can learn a lot about the game mechanics even without seing a single line of source code.

Anyway keep up the good work!
Thanks mate for the kind words, and bugs! haha :)
I will be fixing these as soon as I can! ;)

cheers,
Paul

paul_nicholls
26-01-2012, 10:02 PM
and here is the
OnUpdateInput method:

procedure TTheProbe.OnUpdateInput(aTimeSlice: single; var aExecuting: boolean);
const
cFileName = 'untitled_level.lvl';


var
MouseX,MouseY : LongInt;
SelectedTile : PEngineObject;
MousePosValid : Boolean;
ClickedButton : TEditorButton;
Firing : Boolean;
KeyCode : LongInt;
MouseButton : LongInt;
GameControllerIndex : LongInt;
GameControllerButton : LongInt;
LeftDown : Boolean;
RightDown : Boolean;
XDiff : Integer;
YDiff : Integer;
x,y : Integer;
begin
// update any controls that need programming
if FUpdatingControl then
begin
xeEngine.Window.GetFirstHitInput(KeyCode,MouseButt on,GameControllerIndex,GameControllerButton);


if KeyCode = KEY_ESCAPE then
FUpdatingControl := False
else
begin
if KeyCode <> -1 then
begin
if FControlToUpdate in[GameKey_MoveUp,GameKey_MoveDown,GameKey_MoveLeft,G ameKey_MoveRight,GameKey_Fire] then
begin
FConfiguration.Controls[FControlToUpdate] := KeyCode;
FUpdatingControl := False;
end;
end;


if GameControllerButton <> -1 then
begin
if FControlToUpdate = GameJoy_Fire then
begin
FConfiguration.Controls[FControlToUpdate] := GameControllerButton;
FUpdatingControl := False;
end;
end;
end;
end;


if not FUpdatingControl and not Assigned(FRenderActiveGUI) and not FSingleLevelMode and (FDoors.Status = cDoors_Open) and (FGameMode = gmMenu) and Assigned(FActiveMenu) then
begin
if xeEngine.Window.KeyIsHit(FConfiguration.Controls[MenuKey_MoveUp]) or
GameControllerMovedUp then
FActiveMenu.MoveUp
else
if xeEngine.Window.KeyIsHit(FConfiguration.Controls[MenuKey_MoveDown]) or
GameControllerMovedDown then
FActiveMenu.MoveDown
else
if xeEngine.Window.KeyIsHit(FConfiguration.Controls[MenuKey_Execute]) or
(xeEngine.Window.KeyIsHit(KEY_KP_ENTER)) or
GameControllerFired(FConfiguration.Controls[GameJoy_Fire]) then
begin
FActiveMenu.ExecuteSelectedItem;


if FTerminated then aExecuting := False;
end;
end;


if not FUpdatingControl and not Assigned(FRenderActiveGUI) and not FShowEditorGUI then
begin
if (FGameMode = gmGamePlaying) and (FPlayerData.PlayerMode = pmNormal) then
GetPlayerInput
else
begin
if FGameMode = gmGamePlayerDead then
begin
Firing := PlayerFiring;


if Firing and (FProbeEngine.NumScansSinceProbeSeenAlive >= cMaxPlayerScansBeforeDead) then
begin
if not FSingleLevelMode and not FEditorEnabled and (FLives = 0) then
begin
// go back to menu
FDoors.Status := cDoors_Closing;
FLastGameMode := gmNone;
end
else
// no menu, so just restart game again
begin
ResetGame;
if FLives = 0 then
FLives := cDefaultLives;
FGameMode := gmGamePlaying;
end;
end;
end
else
if FGameMode = gmGameLevelComplete then
begin
Firing := PlayerFiring;


if Firing and (FLevelCompleteTimer <= 0) then
begin
NextLevel;
end;
end;
end;


if not FUpdatingControl and not Assigned(FRenderActiveGUI) and FEditorEnabled and (xeEngine.Window.KeyIsDown(KEY_LCTRL) or xeEngine.Window.KeyIsDown(KEY_RCTRL)) and xeEngine.Window.KeyIsHit(KEY_E) then
begin
FShowEditorGUI := True;
FPlayerData.PlayerMode := pmNormal;


if FConfiguration.MusicEnabled then
begin
if Assigned(FMenuMusic) then FMenuMusic.Resume;
if Assigned(FGameMusic) then FGameMusic.Stop;
end;


ResetGame;
end;


if not FUpdatingControl and not Assigned(FRenderActiveGUI) and xeEngine.Window.KeyIsHit(KEY_S) and (xeEngine.Window.KeyIsDown(KEY_LCTRL) or xeEngine.Window.KeyIsDown(KEY_RCTRL)) then
begin
// commit suicide since playing game
FProbeEngine.CommitSuicide;
end;
end
else
if not FUpdatingControl and not Assigned(FRenderActiveGUI) and FShowEditorGUI then
begin
// scroll editor level to allow clicking outside the level
// to place items and expand level automatically.
if xeEngine.Window.KeyIsDown(KEY_W) then
SetMapOffsetY(GetMapOffsetY - cEditorScrollSpeed * FTimeSlice)
else
if xeEngine.Window.KeyIsDown(KEY_S) then
SetMapOffsetY(GetMapOffsetY + cEditorScrollSpeed * FTimeSlice)
else
if xeEngine.Window.KeyIsDown(KEY_A) then
SetMapOffsetX(GetMapOffsetX - cEditorScrollSpeed * FTimeSlice)
else
if xeEngine.Window.KeyIsDown(KEY_D) then
SetMapOffsetX(GetMapOffsetX + cEditorScrollSpeed * FTimeSlice);


// previous/next tile list in editor
if xeEngine.Window.KeyIsHit(KEY_UP) then
PreviousTiles(cTileHeight + 1)
else
if xeEngine.Window.KeyIsHit(KEY_DOWN) then
NextTiles(cTileHeight + 1);


SelectedTile := GetSelectedTile;
if Assigned(SelectedTile) and (SelectedTile^.Id in cTurnableObjects) and (SelectedTile^.Value <> cObjTravelTube_ud) and (SelectedTile^.Value <> cObjTravelTube_lr) then
begin
if xeEngine.Window.KeyIsHit(KEY_SPACE) then
// rotate selected tile right
SelectedTile^.Attrib := NewDirection(SelectedTile^.Attrib,cTurnRight)
else
if (xeEngine.Window.KeyIsHit(KEY_X) and (SelectedTile^.Attrib in [cLeft,cRight])) or
(xeEngine.Window.KeyIsHit(KEY_Y) and (SelectedTile^.Attrib in [cUp,cDown])) then
// flip selected tile around perpendicular axis
begin
SelectedTile^.Attrib := NewDirection(NewDirection(SelectedTile^.Attrib,cTu rnRight),cTurnRight);
end;
end;


xeEngine.Window.GetMousePos(MouseX,MouseY);


MousePosValid := (MouseX < cPageWidth) and (MouseY >= GetMapY) and (MouseY < (GetMapY + cPageHeight)) and not FScrolling;


if MousePosValid then
begin
MouseX := Floor((MouseX - GetMapX + GetMapOffsetX) / cTileWidth);
MouseY := Floor((MouseY - GetMapY + GetMapOffsetY) / cTileHeight);


if xeEngine.Window.KeyIsDown(KEY_LSHIFT) or xeEngine.Window.KeyIsDown(KEY_RSHIFT) then
// mode where starting or finishing a link
begin
if FActiveLinkInfo.PointIndex = 1 then
// draw active link to current mouse tile if valid
begin
FActiveLinkInfo.Points[1] := Position(MouseX,MouseY);
end;


if xeEngine.Window.MouseIsHit(cMouseButton_Left) then
begin
if FActiveLinkInfo.PointIndex = 0 then
begin
FActiveLinkInfo.PointIndex := 1;
FActiveLinkInfo.Points[0] := Position(MouseX,MouseY);
end
else
if FActiveLinkInfo.PointIndex = 1 then
begin
FActiveLinkInfo.PointIndex := 0;
FActiveLinkInfo.Points[1] := Position(MouseX,MouseY);


FProbeEngine.AddLink(FActiveLinkInfo.Points[0].x,FActiveLinkInfo.Points[0].y,
FActiveLinkInfo.Points[1].x,FActiveLinkInfo.Points[1].y);
end;
end
else
if xeEngine.Window.MouseIsHit(cMouseButton_Right) then
begin
FProbeEngine.DeleteLinksAt(MouseX,MouseY);


if FActiveLinkInfo.PointIndex = 1 then
begin
if (FActiveLinkInfo.Points[0].x = MouseX) and (FActiveLinkInfo.Points[0].y = MouseY) then
// delete active link as clearing links at same location as link start
FActiveLinkInfo.PointIndex := 0;
end;
end;
end
else
begin
FActiveLinkInfo.PointIndex := 0;


LeftDown := xeEngine.Window.MouseIsDown(cMouseButton_Left);
RightDown := xeEngine.Window.MouseIsDown(cMouseButton_Right);


if LeftDown or RightDown and Assigned(SelectedTile) then
begin
if MouseX < 0 then
// expand level left
begin
XDiff := Abs(MouseX);
FProbeEngine.InsertLeftColumns(XDiff);
MouseX := 0;
// update offset to support insertion
SetMapOffsetX(GetMapOffsetX + cTileWidth * xDiff);
end
else
if MouseX >= FProbeEngine.Width then
// expand level right
begin
XDiff := Abs(MouseX - FProbeEngine.Width) + 1;
FProbeEngine.InsertRightColumns(XDiff);
MouseX := FProbeEngine.Width - 1;
end;


if MouseY < 0 then
// expand level up
begin
YDiff := Abs(MouseY);
FProbeEngine.InsertTopRows(YDiff);
MouseY := 0;
// update offset to support insertion
SetMapOffsetY(GetMapOffsetY + cTileHeight * YDiff);
end
else
if MouseY >= FProbeEngine.Height then
// expand level down
begin
YDiff := Abs(MouseY - FProbeEngine.Height) + 1;
FProbeEngine.InsertBottomRows(YDiff);
MouseY := FProbeEngine.Height - 1;
end;
end;


if LeftDown then
begin
SelectedTile := GetSelectedTile;
if Assigned(SelectedTile) then
SetObjectAt(FProbeEngine,MouseX,MouseY,SelectedTil e.Value);
end
else
if RightDown then
SetObjectAt(FProbeEngine,MouseX,MouseY,cObjSpace);
end;
end
else
begin
ClickedButton := GetLastEditorButton;


if ClickedButton = ebNewLevel then
// do new blank level
begin
LoadLevel(
[
'TTTTTTTTTTTTT',
'T T',
'T T',
'T T',
'T T',
'T P T',
'T 3 T',
'T 222 T',
'> 11111 <',
'TTTTTTTTTTTTT'
]
);
SetMapOffsetX(0);
SetMapOffsetY(0);
end
else
if ClickedButton = ebSaveLevel then
// TODO: add GUI to ask for location + filename
begin
if FileExists(FLevelName) then
FProbeEngine.SaveLevelToFile(FLevelName)
else
FProbeEngine.SaveLevelToFile(ExtractFilePath(Param Str(0)) + cFileName);
end
else
if ClickedButton = ebLoadLevel then
// TODO: add GUI to ask for location + filename
begin
if FileExists(ExtractFilePath(ParamStr(0)) + cFileName) then
FProbeEngine.LoadLevelFromFile(ExtractFilePath(Par amStr(0)) + cFileName);
SetMapOffsetX(0);
SetMapOffsetY(0);
end
else
if ClickedButton = ebTestLevel then
begin
FProbeEngine.BackupLevel;
FShowEditorGUI := False;
ResetGame;
FGameMode := gmGamePlaying;


if FConfiguration.MusicEnabled then
begin
if Assigned(FMenuMusic) then FMenuMusic.Pause;


LoadMusicTrack(FMusicTrackOrder[FMusicTrack]);
end;
end
else
if ClickedButton = ebCountCrystals then
begin
FProbeEngine.CountCrystals;
end;
end;
end;


if xeEngine.Window.KeyIsHit(KEY_F5) then
xeEngine.Graphics.SaveTGAScreenShotToFile('screens hot_'+FormatDateTime('yyyymmdd_hhnnss',Now)+'.tga' );
end;

As you can see it could use some refactoring! haha

cheers,
Paul

SilverWarior
27-01-2012, 02:07 PM
From what I see your do have a bad overal code structure. No offense but I think you should do a compleete rewrite of the code. Yes I know that it would be a lot of work, but in the end you will benefit from much nicer structure wich will alow you to track bugs more easily and even lower the chances of new bugs hapenning, add new fetures, etc.
I would recomend to use overal code structure similar to somethink like this (writen from head):
1. Game initialization
1.1. Initialize graphic engine
1.2. Initialize sound engine
1.3. Initialize input conrols
1.4. Load most necessary graphics (the ones requred for main menu)
1.5. Load most necessary sounds
1.6. Set the game state to gsMainMenu
2. Check the current gamestate
2.1. If gamasteate is gsMainMenu then do te code for main menu
2.1.1. Set input controls for main menu
2.1.2. Render the main menu
2.1.2. Make sure only main menu music is playing
Here I asume your sond engine alows you to have mupltiple chanels for playing of multiple streams
2.1.2.1. If some other music is playing except Main Menu music make transition by lowering lowering volume of those chanels, start playing main menu but do so with low volume. Then avery cycle repeat process except that this time jou just lower the volume of other chanels and raise volume of MainMenu music chanel. When the volume of other chanels reaches zero you stop their plaback.
The amount of decreasing and increasing volume should be calculated based on volume settings so that the transition is done in certain amount of cylces.
2.1.3. Check wich menu item is presed
2.1.3.1. If new game is presed then check if there is already an active game
2.1.3.1.1. If there is already an active game notify the user that by starting the new game he will lose all the progres off a current game
2.1.3.1.1.1. If user confirms set gamestate to gsNewGame
2.1.3.1.1.2. If user does not confirm return to main menu
2.1.3.1.2. If there isnt an active game already set gamestate to gsNewGame
2.1.3.2. If Resume game is presed change gamestate to gsGame
2.1.3.3. If Options is presed change gamestate to gsOptions
2.1.3.4. If Exit game is presed check if there is already an active game
2.1.3.4.1. If there is an active game notiffy player that by exiting the game he will lose all the progres
2.1.3.4.1.1. If the player confirms then set gamestate to gsExit
2.1.3.4.1.2. Else return to main menu
2.2. If gamestate is gsNew game do new game initialization
2.2.1. Check if there is an active game already
2.2.1.1. If it is clear the resources of the current game
2.2.1.2. Else initialize the new game
2.2.1.2.1. Load necessary resources
2.2.1.2.2. Load level
2.2.1.2.3. set gamestate to gsGame
2.3. If gamestate is gsGame then
2.3.1. Check if inoly ingame music is playing
2.3.1.1. If not make transition similar than win main menu code
2.3.1.2. Else continue wit oher code related to gameplay
2.3.2. Set input controls to ingame controls
2.3.3. Do teh game related procesing
2.3.4. If game is over set gamestate to gsEndGame
2.3.5. Render game
2.4. If gamestate is gsEndGame clear ingame resources
2.5. If gamestate is gsOption do stuf necessary for option menu
2.6. If gamestate is gsExit start finilizing input, soung engine, graphic engine and finally close application.
While this can look quite scarry at first it actualy isn't so cary. Especialy when you se that by having this kind of structure for your game would alow much more understanding code and also prevent bugs to ocur in any other parts of your code except the one you have been changing. The only ecpetion to this is if you change some code related to graphic engine, sound engine, etc.

paul_nicholls
28-01-2012, 01:20 AM
Thanks for the details mate :)
I definitely am going to re-factor the code to help reduce bugs as you suggest, but I think I am going to use separate routines for each game state to separate out the stuff more and make the code less bug free...

We will see how I go :)

SilverWarior
28-01-2012, 07:03 AM
Using seperate routines for each gamestate is a good idea. Also I suggest using regions. While regions don't affect how the program will run, they can make code much more readable. The main advantage of regions is the fact that they alow you to fold the code wich is inside the region. And since you can define region boundaries as you see fit (any line you want) you gain ability for folding any part of the code. Another neat function is ability to name them with any string. So by chosing suitable name or. decription you can easily know what code in certain region is used for.
For instance:


{$REGION 'Make sure only menu music is playing'}
if IngameMusic.Playing then
begin
{$REGION 'Fade from ingame music to menu music'}
if not MenuMusic.Playing then
begin
MenuMusic.Volume := 0;
MenuMusic.Play;
end;
if IngameMusic.Volume = 0 then
begin
IngameMusic.Stop;
Exit;
end;
//Reduce volume of ingame music channel
if IngameMusic.Volume > 0 then IngameMusic.Volume := IngameMusic.Volume - 10;
//Increase volume for main menu music chanel
if MenuMusic.Volume < 100 then MenuMusic.Volume := MenuMusic.Volume + 10;
{ENDREGION}
end;
{ENDREGION}

paul_nicholls
28-01-2012, 07:29 AM
Regions, eh? Hmm...might be a good idea :)
I don't know if Lazarus/Freepascal supports them though...I need my code to compile under Lazarus to make a Linux version.

cheers,
Paul

SilverWarior
28-01-2012, 07:54 AM
Yes it does support them. And if I'm not mistaken delphi has taken that after lazarus.

paul_nicholls
28-01-2012, 08:18 AM
Yes it does support them. And if I'm not mistaken delphi has taken that after lazarus.
LOL! Ok, cool :)

Actually, talking about re-factoring...how would you feel if I made the menus for The Probe clickable using a mouse only? I am thinking this would be in preparation for a touch interface later on down the track if I make an Android version :)

So I might have some worlds to click on, and then the unlocked levels would be as icons you can click on for example like in Angry Birds and other games...

Legolas
28-01-2012, 08:54 AM
Lazarus supports regions in two flavors:



{$REGION Fold anything you want}

{$ENDREGION}


and



{%REGION Fold anything you want}

{%ENDREGION}


Though the first one should raise a warning from the compiler :)

paul_nicholls
28-01-2012, 11:00 AM
Thanks Legolas :)
PS. I haven't seen you around much lately on PGD ;)

SilverWarior
28-01-2012, 11:15 AM
Actually, talking about re-factoring...how would you feel if I made the menus for The Probe clickable using a mouse only? I am thinking this would be in preparation for a touch interface later on down the track if I make an Android version :)

So I might have some worlds to click on, and then the unlocked levels would be as icons you can click on for example like in Angry Birds and other games...

I don't think that making menu only clickable is a good thing.
Yes having ability to click on menu items would come in handy for touch screen devices. But sticking only to clickable items would make life for PC users a bit more complicated, especialy for those who likes using gamepads and other controlers. Anywhay having keyboard suport in menu is just a few lines of code more.

About unlocked levels having icons for user to click on would be a great idea. Another great idea would be multiprofile support (each player has his own profile).

paul_nicholls
28-01-2012, 12:06 PM
Ok, thanks for the feedback...I will keep the menus usable by keyboard + controller, and mouse for touch later on :)

Separate profiles would be a good idea...thanks! :)
Well, I'm off to catch some ZZZ now - it's 11:04pm here in Tasmania, Australia! :D

Legolas
28-01-2012, 12:10 PM
Thanks Legolas :)
PS. I haven't seen you around much lately on PGD ;)

Yes, I'm in "lurking mode" mood lately :)
By the way, I'm doing a complete refactoring on my chip16 emulator, adding the new opcodes too. Maybe I'll use your audio unit because it works just great ;)

paul_nicholls
28-01-2012, 08:59 PM
By the way, I'm doing a complete refactoring on my chip16 emulator, adding the new opcodes too. Maybe I'll use your audio unit because it works just great ;)

Cool! Glad I could help in the audio department ;)

cheers,
Paul

paul_nicholls
31-01-2012, 03:51 AM
Well, I have updated the website for The Probe now...I have added a "Contact" page (send messages, etc. to me) and a "Submit/Review Bugs" page.
So when bugs are found from now on, if you could try submitting bugs to the website now, I can keep up on top of them and not forget them :)