Yeah, that is a bit slow. I noticed it most when the window wasn't in focus. Otherwise it's quite good.
Oh, and how in the world did you get teh EXE so small? StripReloc and UPX are what I use, but they don't get THAT small.
Yeah, that is a bit slow. I noticed it most when the window wasn't in focus. Otherwise it's quite good.
Oh, and how in the world did you get teh EXE so small? StripReloc and UPX are what I use, but they don't get THAT small.
The size is so small because it doesn't use any VCL.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
THAT file wasn't compiled under Lazarus.
As for the slow-down, I'm quite sure it's a result of the leak. The other night I was watching TV while programming. I ran the program and forgot about it and when I came back it was complainning about havintoo big a swap file. :?
Where it is... I have no clue to be embarassingly honest. But I should find it before I go much further with the engine.
Anyone find anything?
WILL
the most obvious is not freeing an SDL Surface. Are you creating surfaces on the fly ( for text maybe? using SDL_TTF?) I had the same problem on one of my apps beforeI knew it it was up to 32 meg of memory, then crashed. ops:
Dean
<A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
<br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
<br /></A>
found the problem
// New Screen! -- Draw Background
SDL_BlitSurface(Background[0], PSDLRect(0, 0, GameScreen.w, GameScreen.h), GameScreen, PSDLRect(0, 0, GameScreen.w, GameScreen.h));
the PSDLRect does a new to create a new instance of TSDL_rect then returns the pointer to you, which you must free.
Better to declare a local variable in GameCycle of TSDL_Rect ,
[pascal]
procedure GameCycle;
var Rect: TSDL_Rect;
begin
// Check Player Input
doGameInput(False);
// Game AI Input
// Perform Game Physics
Player1.Move(Levels[0]);
// Check Game Actions
// New Screen! -- Draw Background
Rect := SDLRect(0, 0, GameScreen.w, GameScreen.h)
SDL_BlitSurface(Background[0], @Rect, GameScreen, @Rect);
// Draw Tiles
DrawTiles(Levels[0]);
// Draw Sprites
Player1.Draw(GameScreen, ScreenX, ScreenY);
// Draw Effects
// Draw Foreground
// Draw FramesPerSecond!
{ Update Screen }
SDL_Flip(GameScreen);
end;
[/pascal]
or just pass nil instead of SDL_Rects as this will blit the entire surface. The same thing is in DrawTile as well.
Dean
<A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
<br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
<br /></A>
Good eye Dean!
You really notice the difference...
Well, I guess that I can continue to tweek the scrolling code and game objects, etc...
I'm really trying to push as much stuff into the engine before I start the map/level editor... Simply because the more that I have in the main engine, the less I'll have to copy over to the level editor version.
What I'm planning is to do is add a whole bunch of menus and mouse functions to create and design your maps and that'll make up most of the map editor for development.
The only other tools I'll need are little things, like the AI trainners, packers and such.
I also plan on using NNs with GAs for the Boss AI. I'm not sure how I'll arrange it's use, but it will be capable of learning from your playing the game.
I was hoping to use NN's in my project for AI. Anyone got any good NN units or training examples, it's been a while. :?
<A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
<br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
<br /></A>
I think it needs a scripting engine. Then we can all make mods
Homepage - http://incubii.port5.com
Well I think that the scripting will be needed for making it a bit more dynamic then just run through and shoot things.
Changing of background graphics when you pass through a tunnel or get outside... Character dialogs and interactions... and even small triggers and switches in the levels.
Luckily I have already had some experience with my first scripting engine in my SkyBlast Engine Project.
Well in a private message to K4Z about development of this game, I wrote up an interesting peice of text that describes how I plan on putting all the major peices together and what the more exciting features of the game would be. So, here is what I wrote.
I plan on creating a map/level editor soon that I can use to create maps for the robot to run through. From there I can move on to scripting enemies (with a enemy creator that will handle assigning animations and AI stuff), scripted objects, animations, events and dialog. Pretty much anything that doesn't involve the map directly. Think of the scripted objects and enemies like a seperate layer of the game level.
It'll come together something like this:
1) You maps...
2) Your level script with events and triggers for in-game manipulation...
3) Your enemy, player, weapon and item objects pre-made and used by the scripts and game engine.
4) The game engine and menu code that binds it all together.
5) Extra features, game modes, etc...
At least this is a rough description of what the game's makeup will be like. Don't forget the Boss battles too. I think I will need a battle mode where you can run it as a player vs. player, AI vs. player or AI vs. AI for learning mode. As I will be using Neural Nets for the bosses so that they will learn and will be more effective as opponents. The 'trainning' portion will require AI vs. AI so that I can run it a few hundred times so that they will evolve enough. It's a process that takes time to do, but it's all a semi-automated task, which is kind of neat.
I think that the main selling point of this game will be the advanced AI technique. Of course a multi-player co-op and battle modes would be fun for Internet/LAN play. Wouldn't it be fun to play as any of the types of evil robots that you discover in the game? You unlock new robots to battle as by uncovering secret locations/discs or something? Or by simply defeating a new boss allows you to play as/against him in multi-player battle mode.
Bookmarks