Monday, May 26, 2014

Bugs, go away!

How many bugs are unknown in your application by average?

BB)

  • Tile cache in maps was not clear after new level (didn't affect game play)
  • Fixed error when creating screen buffers, first thing should be always create material 
  • Buffer ent code improved (3d stuff)
  • Files searches in big file are now much faster
  • Fixed when rendering to texture and the surfaces were lost lead to an AV
  • Fixed a new collision weird assignation
  • Triggers can be executed from the code
  • Fixed an issue with module volume
  • Closure versions of Engine.Find() and Engine.SpritesAt()
  • Closure version of Layer.ScanAttributes()


HBF)

  • New element flower
  • New element star 
  • New element boom 
  • New cotton element 
  • New effect fire wall
  • Snow improved
  • New mechanic enemy beetle 
  • Now hero is pushed down properly from falling items
  • Reminiscence music for intro
  • New sound for last battle
  • Web fall after 1 second of catching a sprite 
  • Fire was moving when in pause 
  • New secret level 
  • Game could not be finished twice
  • Fixed some bugs in the platform bouncers
  • Code related to levels and profile cleaned
  • Issue with boss1 and its fire balls (compiler should warn about non initialized array)
  • Hero with shield is now not affected by web 
  • Platforms now also get default layer var
  • Candle light does not move when in Pause
  • Ray pillar colorkey was not correct
  • Dialog can be seen properly in darkness
  • Now boss1 fire balls emit light in darkness
  • boss1 = kurkani 
  • Snow should be now be more sparse
  • Runes and coins now collide with tiles/items on top
  • More type of candles 
  • New fire jumping ball
  • Crepuscule can be set from top
  • Start Z properly adjusted
  • All circular enemies collision shape set to csCircle
  • All rotating enemies do not longer react to the Reverse event
  • New interface IHud
  • Now Finish screen shows the number of lives 
  • When hero dies with gravity up it falls down
  • Now game uses the closure versions in some functions that are used quite a lot, meaning no overhead creating lists 
  • Fixed a collision when tile vs item when gravity is up
  • Fixed a gravity collision issue, it was not affecting beetles because of its height
  • Gravity color switch is now faster
  • Spider now correctly does not get too close to hero when he has immunity
  • Fixed a weird collision issue when the gravity change too close to a tile


Sunday, May 4, 2014

"Only" improving the graphics is pending

Thanks to JLG the sound/music part is almost done, great job men!

Now pending for the graphic part...

HBF)

  • Dialogs can be skipped pressing return
  • Removed some unused variables in focus 
  • Finally fixed some silly bat bug
  • Removed some unnecessary collision detections against hero
  • Fixed an issue with speed factor
  • Removed some unused units
  • Keys now rotate
  • Now all levels have music 
  • TScreen new property GameServices and refactoring
  • Ending more or less finished
  • Deleted some legacy 3d resources
  • Droid was not taking properly the orientation
  • New sound for the magical stuff
  • Enemies cannot hit hero when he is already dead
  • Highscores screen have a gradient background
  • New sound for balloons exploding
  • Source structure refactored
  • WrongPlace() now is much more accurate with for instance lava
  • Hit animation improved
  • World background is now different
  • All tiles are now 64x64 rather than 64x62
  • New sound when stalactite breaks
  • New TGameSprite GetDefaultHorizontalSpeed
  • TD3D Colorkey improved a bit 
  • Now hero has 5 lives
  • Shadows are "dynamic"
  • Die animation is much faster
  • Fight screen now takes the current view rather than a flat background 
  • All sounds are normalized 
  • Levels starts with a zoom 
  • Darkness is not so dark anymore
  • New colors for the finish level screen 
  • Transition musics are now coming from configuration
  • New screen when entering the game, deja voo!
  • Error with bubbles when in bottom of the Level
  • Using Bass rather than fmod 
  • Sound queue improved
  • Improved the use of GameServices in GameSprite leading to less code
  • Book sprites rather than egg
  • Rain is now diagonal
  • New achievement, kill all enemies (very tricky!)
  • New wind sound 
  • Dragon tail now cast shadow 
  • Layer 1 and 2 uses the same Z
  • Egg has been discarded, now a book it is used which makes more sense in the fight
  • When candles are off they do not emit more light when in darkness
  • New pickup Skull, beware...


BB)
  • New TSurface.key reference to related classname so it is easier to debug 
  • TSurface2Poly.Tolerancy should be an integer not a float
  • Removed some really silly $IFDEF in TSurface which makes really weird random errors 
  • Tag removed from some classes that already have them since they inherit from TObjectEx
  • TSimpleSprite.LoadFile() was not passing correctly the colorkey wo the stream overloaded version
  • Some really weird visual issues fixed
  • Now FillSurface() does all the job, move the data from the bitmap to the surface, does the colorkey and also the flipping, this improves the assignation of surfaces
  • New TSurface.SurfaceType field with options: default, managed and target
  • D3D specific classes improved a bit
  • Improving TSurface.Blit()
  • Added support to BASS sound system
  • TSurface.Blit() errors fixed
  • New engine.Exists() a fast function in order to check if a certain class exists 
  • New Layer.number property
  • Fixed a z shadow bug, it was not updated properly in TAnimationSprite
  • Trigger parameters can now be booleans
  • Items now also trigger the event OnReadCell()
  • Alpha tiles do not cast shadows 
  • Removed some warnings in BigFile

Thursday, April 24, 2014

Bug fixing, the never ending story

Fixing bugs, do they ever finish? :-)

All binaries should be at skydrive 

BB)

  • New Engine.Debug property (it set all related sprites to debug)
  • TLayer.Trace() could raise a AV since under certain conditions a cell can be null 
  • Events from sprites moved to their own new class TEvents 
  • Screen buffers size is now a property


HBF)

  • Final boss getting better
  • When final boss dies he liberates the key
  • Final boss has a new sound when flapping the wings
  • SpriteFactory now gets IGameServices rather than many properties
  • Arrows behave better against bullets
  • New enemy mine, it  has a gravity factor of 2 and kills Enemies
  • Finally rays have a pillar 
  • New trigger method ItemOffset() in order to change the current tile
  • Die sound is more calm (it was too loud)
  • New horizontal trap doors
  • Bomb has a gravity factor of 2
  • One can observe the rendered tiles (used in final boss for heating ice)
  • New method PreciseCollideAgainstTiles(): bool which tests 8 precise collisions
  • GravitySwitcher now publishes Flashing and Quake duration properties
  • Mirror checks for obstacles (if there is an obstacle then the sprite cannot be mirrored)
  • Stalactite, flame and wall now  properly check for collisions (not only for spatial partitioning)
  • Droid,eye and final boss heats the special ice cubes and also mechanic enemies
  • Eye now publishes initial angle and laser color 
  • Arrows are now enemies
  • Candle vanish slowly
  • New Focus element (used in Colors screen)
  • Focus color can now be set as and mask via DirectColor attribute
  • Spotlight now slows down also enemies
  • Published attributes can now also be enumerators
  • Spider web when touching sprites they get locked until the web disappears
  • SLOW_VAR removed, instead SpeedFactor is used
  • Runes are now shown in the achievements menu and not in the hud
  • Observers are cleared properly otherwise AV
  • Candle new property off so when true it won't emit light when in darkness 
  • A bit clever approach for the sounds pool
  • Fixed a small issue with the steps when taking the key 
  • Now when the default resolution does not work, the game properly restarts at 1024x768


Friday, April 11, 2014

"Close" to finish

Well, it is time to close this never ending project, so I'm just trying to focus on bugs and last boss level.

All files should be at skydrive  (well, sources not any longer)


HBF)
  • From triggers you are able to pause and continue the game showing some text
  • Trigger dispatcher now gets all the info from IGame
  • New interface IDialog
  • Mummy jumping areas detected more accurately
  • More music!
  • TGame.SpawnAttributes() refactored a bit
  • Rotated coins attributes are now published
  • New sources folder structure
  • Items bound not only when finding a bounce attribute but also when colliding with a solid tile
  • Items can also have set their properties (clouds, on/off, moving tiles, red ball and spring)
  • Last level boss fight! (wip)
  • New sound when balloons explode 
  • Bird does no longer appears from no where... (bug fixed)
  • New sound for eggs 
  • New sound for arrows
  • New sound  for rain
  • New sound for menu 
  • Now pause has a sound 
  • Some pickups have a new sound 
  • Fish animation is now PingPong rather than circular
  • Stalactite does not fall if hero is dead
  • Text dialogs fit a bit better
  • New menu Music
  • Platforms code refactored a bit

BB)
  • Font stuff moved to BB.Screen.Fonts
  • New method Layer.GetExtraAt()
  • Map triggers have a new property align which tells the system how to align the trigger (only for collision purposes since they are invisible)
  • ITag removed from some classes since they derived from TObjectEx which already implements that interface
  • TSprite IsOutOfScreen is a bit more consistent
  • Now the engine can be paused  (much more handy and easy than pausing all enemies)

The final boss


Monday, March 31, 2014

Attributing

Now it was time to apply values to attributes in real time in order to let the potential designer the power to desire the levels behavior (in this case the designer is me...)

Of course this is achieved via rtti and publishing all interesting properties, in our case:
  • Colorkey
  • Collision info
  • Effect (add, sub, multiply, inverse)
  • Filter
  • Angle
  • Color
  • Horizontal speed
  • Vertical speed
  • Zoom
  • Acceleration
  • Friction
  • Gravity
  • Facing
  • Animation info
  • Shadow info
  • Sleep
  • Timeout
  • Coordinate system
  • Group
  • Flip x/y
  • Visible
  • X/Y/Z coordinates
Also all special attributes from all entities in the game are published.

All files should be at skydrive  (well, sources not any longer)


BB)
  • Scanning polygon algorithm is now more accurate, I hope this fixes some weird collisions 
  • New TSurface.Target property used when rendering to texture
  • When calling TScreen.SetRenderToTexture() the system first render to a texture and then to screen 
  • Screen quad can be zoomed and rotated thanks to the rendering to texture
  • Fonts can be now loaded from big file
  • When setting a sprite as no colorkey the bounding box is also set to full rectangle 
  • One Trigger can now have multiple calls (before it was one trigger one call)
  • Many class properties are now published in order to be accessible from Map editor
  • TLayer has a new method in order to get information about properties called GetPropertyAt()
  • Map extras now cast shadows (like fire animations)
  • Shadows can now be assigned at any time, not only before assigning a surface
  • Sprites take by default the shadow from the engine (if available)
  • Attached engines in maps take the shadow from the Map
  • TSound keeps the name of the loaded song (useful for debugging)
  • Y shadow offset set by default to 4 (before it as +4)

HBF)
  • Enemies getting angry code refactored (now it is generic)
  • Spike ball now rotates according to its angle 
  • Fixed some platform code issues when gravity was up
  • OnPickup event removed, always use OnDie
  • Bouncing code refactured and tunned
  • Finally new "legal" music is coming (thanks to herotyc/xplsv^asynkro)
  • New crepuscule lights here and there
  • Enemies cannot longer activate moving platforms (only hero does it)
  • Now hero collides properly with moving items when gravity is up
  • When bubbles are exploded with head, the jump is not stopped
  • Stalactites now breaks items and kills enemies
  • Fixed a bug with camera where in some levels was showing stuff outside the map
  • More accurate balls bouncing (level severe gravity)
  • Fight now respects the current shader 
  • Dialogs can be paused 
  • Dialogs can be chained
  • Game now shows some dialogs while playing
  • Arrows now can have dynamic speed
  • More entities get published attributes
  • Now candle fades slowly 
  • Waterfall now has a sound 
  • Fight screen was stopping all sound, that's wrong now it pauses all sounds 
  • Outside there level does not longer cast shadows (since it does not have background)
  • New font 16x16 for dialogs
  • Blob speed set to 1.5
  • Spider leaves webs while walking
  • Droid collisions improved

Better sun lights


Monday, March 17, 2014

Stabilizing HBF

Playing a bit more with scripts and gravity and also trying to stabilize the game.

All files should be at skydrive 

BB)

  • 32 bits textures are recognized and used in a better way
  • TCollisionMatrix more stable when coordinates are outside the grid


HBF)

  • New element ventilator (used in No Name)
  • Triggers can lock/release the keyboard
  • New triggers: FadeIn, FadeOut, SetVar , ShowEntity, ShowHero, LockInput and ReleaseInput
  • Fixed an issue replaying demos 
  • New gravity switcher up/down
  • Gravity down bitmaps are now blue
  • Gravity color shifting cadency it's now slower
  • Fixed an issue when graviting (system thought it was colliding up and down)
  • TEffectDispatcher is now singleton (many classes need to use it)
  • Many counters now use TTimeHelper.AsSteps() (converts milliseconds into game steps)
  • Time pickup now only slowdown mechanical enemies
  • Bomb now gets angry with different gravities
  • Dragon slower (used in Colors)
  • Teleports cannot be reused when are in used
  • All normal enemies get angry when touching flames
  • Bubbles spawning cadency increased  

Sunday, March 9, 2014

Focusing on triggers

It's been a while since the last update, so it is about time to do something...

All files should be at skydrive 

BB)

  • Params trigger now accepts string values
  • Fixed a bug when in a trigger the same function is called more than one it would always get the same parameters
  • Remove TSprite.UseEngineZ and added TSprite.AlternativeZ


HBF)

  • When in water and bubbles are visible a new sound is played
  • Trigger ClearEntity now works since the attribute it is saved in ENTITY_VAR
  • Blob gets angry when touches a flame
  • Droid's laser was not pausing properly
  • New explosion for walls
  • New giant gear wheel (not used yet)
  • Egg is now nicer
  • Sounds can be searched by name
  • New trigger dispatchers: SetParallax, SetNight, ClearItem, Flash, Quake, ShowText, StopMusic and StopSound
  • New unit Dialogs, that helps showing text on screen
  • Playing demos was letting you play new levels, fixed
  • Escape is not enabled when in pause
  • Spotlight light collision fixed
  • Top VS bottom collisions better handled
  • Hero's tail code improved a little bit





Friday, February 21, 2014

Time for triggers

The main change in this version is that I've added a triggering system, in the map editor one can add as many triggers as he wants.

There is a file for each level called triggers.map

[1]
x=92
y=59
ClearTile=-78,-54
ClearAttribute=0,0
PlaySound=wall.wav

The values mean:
  1. TriggerId
  2. Trigger x position
  3. Trigger y position
  4. Function to call and parameters

Then there is class called TTriggerDispatcher which contains all possible methods to be called, for instance:

procedure TTriggerDispatcher.PlaySound(aX, aY: integer; const aName: string);
begin
  TSoundDispatcher.Instance.Play('Sound\' + aName);
end;

procedure TTriggerDispatcher.SpawnEntity(aX, aY, aOfsX, aOfsY, aEntity: integer);
var
  info: TMapInfo;
  entity: ISprite;

begin
  info := TMapInfo.Create((aX + aOfsX) * FLayer.XTileSize, (aY + aOfsY) * FLayer.YTileSize, NO_TILE, aEntity);
  entity := TSpriteFactory.Instance.New(info);
  (entity as IWarp).Warp;
end;


The way that this is handled is via rtti:


procedure TGameTrigger.Invoke;
var
  info : TRttiType;
  method: TRttiMethod;
  params: TArray<TValue>;
  context: TRttiContext;
  par, i: integer;

begin
  if FTarget = '' then
    raise Exception.Create('Invalid target');

  context := TRttiContext.Create;
  info := context.GetType(TTriggerDispatcher);
  method := info.GetMethod(FTarget);
  if method = '' then
    raise Exception.Create(FTarget + ' does not exists');

  Setlength(params, FParams.Count + 2);
  params[0] := TValue.From<integer>(FX);
  params[1] := TValue.From<integer>(FY);
  for i := 0 to FParams.Count - 1 do
  begin
    if TryStrToInt(FParams[i], par)  then
      params[i + 2] := TValue.From<integer>(par)
    else
      params[i + 2] := TValue.From<string>(FParams[i])

  end;

  method.Invoke(TTriggerDispatcher.Instance, params);
end;

From the map editor one can design some game logic. All files should be at skydrive

 BB)
  • If no animation assigned in TAnimationSprite then the old exception is no longer happening
  • TCollisionMatrix no longer returns the same sprite repeated
  • New trigger system
  • Triggers can dispatch more than one method 
  • Map load/saves triggers
HBF)
  • New balls enemy 
  • New trigger entity
  • New music for level no name
  • CrushWalls fixed
  • When hero is finishing a level, immunity is activated
  • Possible triggers at the moment are: clear and set tiles and attributes, play sound and music and spawn entities
  • When in water and bubbles are shown and new sound is played
  • Triggers used in some levels

Saturday, February 15, 2014

New cloud repository

Since SugarSync insists on making me paying them I've to find alternatives...

All files should be at skydrive



Monday, February 10, 2014

Just another update

Well, just to keep this blog a bit "active" I'm uploading a new version

BTW, SugarSync is already telling me that our deal finishes in 7 days, time to find another place to save the files, but meanwhile here we go SugarSync.

BB)
Engine.Find() and Engine.SpritesAt() returns nil if no sprites (some performance gain)
Minor clipping issue solved (only visible with teleporting)
TDummySprite new property Group
New Engine.Find() per group
New Layer.GetItems() per group
New ICamera.GetPoint()
New ISprite.GetPoint()

HBF)
Music was not resumed after a fight
The under 15 minutes achievement has to be done from the first Level
Hero dies differently...
Shield was not shown when in pause
Some non used graphics removed
Bomb enemy is back with some new explosion (nuclear?)
Bomb now dies with hero shield
All code adapted to Find() and SpriteAt()
Dragon included in level Colors (I think it gets very difficult...)
Spring handling improved
Jumping code harmonized
New falling blocks (crush wall)
New static Play3D() sound that does not need ISprite but TPoint
Time pickup now rather than stop the enemies it just slow them down quite a bit.

Dragon flying around...


Saturday, January 25, 2014

I can play demos

Aside from some small bug fixes here and there, the main change is that HBF can play levels by itself. They can be seen in the Demo menu.

Binaries and sources can be downloaded from SugarSync.

BB)
When adding color to sprites, shadow is no longer affected

HBF)
Now game is able to play demos
I think that finally I caught a nasty bug. Lesson learned: don't internally use fields that you expose for user usage (for example Tag)
New enemy snowball that can freeze the floors when touched (getting smaller)
Many elements now have a shadow (like candle and door)
New bat sound
Pickups can be inactive, used for runes and coins from diamonds
Bubbles explode outside the water
Droid now can also bounce vertically
In order to unlock the achievement "finish with all lives" one must start from first level
Coins that vanish disappear via Warping
Pickups can be active/inactive
New achievement, finish HBF under 15 minutes
One can skip the sentence challenge with escape
System respects the banners order
Coins from Diamonds are affected by friction, and eventually, they stop
Runes don't move after they touch the floor

New soil freezing via snowball:


I can play demos

Aside from some small bug fixes here and there, the main change is that HBF can play levels by itself. They can be seen in the Demo menu.

Binaries and sources can be downloaded from SugarSync.

BB)

  • When adding color to sprites, shadow is no longer affected


HBF)

  • Now game is able to play demos
  • I think that finally I caught a nasty bug. Lesson learned: don't internally use fields that you expose for user usage (for example Tag)
  • New enemy snowball that can freeze the floors when touched (getting smaller)
  • Many elements now have a shadow (like candle and door)
  • New bat sound
  • Pickups can be inactive, used for runes and coins from diamonds
  • Bubbles explode outside the water
  • Droid now can also bounce vertically
  • In order to unlock the achievement "finish with all lives" one must start from first level
  • Coins that vanish disappear via Warping
  • Pickups can be active/inactive
  • New achievement, finish HBF under 15 minutes
  • One can skip the sentence challenge with escape
  • System respects the banners order
  • Coins from Diamonds are affected by friction, and eventually, they stop
  • Runes don't move after they touch the floor


New soil freezing via snowball:


Wednesday, January 15, 2014

Time for achievements

Nowadays a game needs achievements, so why not implement them in my own style?

Binaries and sources can be downloaded from SugarSync.

BB)
Sprites clip are set to empty not only when creating it but also when loading (since I reuse them)
New ISprite.GetCurrentFrame()
Some checks in maps are only done when in DEBUG mode
FlipX() and FlipY() renamed to ToggleFlipX() and ToggleFlipY() and new property FlipX for helping the getters and setters

HBF)
New achievement system, at the moment there are 21.
Achievements visuals are updated always when menu is shown
Princess is now a pickup
New banner system, more handy to use
New music for last level
Change the arrow speed from to 4 (so is a little bit faster than hero)
New golden egg pickup, if taken (it changes its location from time to time) it starts a battle, if battle is won, runes are spawned, try to collect them all
Achievement all coins fixed
Profile system improved
Profile storage now uses a dictionary
Droid only can only kill normal enemies with the laser
Eye only can only kill normal enemies with the laser
New interface IProfile
Hud hows all collected Runes

New fighting room (remember ranarama?)



New golden egg

New achievement system

Many runes to be collected

Monday, January 6, 2014

HBF, first 2014 update

Finally Xmas is over!, in between I found some time to improve this little game mess, latest changes:

Binaries and sources can be downloaded from SugarSync.

BB)

  • Rectangle collision uses bounding boundaries rather than rectangle, so is more accurate
  • New method TCamera2d.Reset()
  • Font can now have a 2d camera 
  • Screen buffers are no longer created with huge size since most of the time they are under used, now they are discarded when more vertices are needed and then exponentially increased, default is now 512 vertex (before it was 32768), memory footprint reduced dramatically
  • New BB.Game.Achievements unit

HBF)

  • Trap door now uses a rectangle collision (it cannot use a polygon shape since the system can only generate one polygon and this bitmap would generate two)
  • HUD refactored a bit
  • Coins stuff moved to HUD 
  • Map tiles changes
  • Bottom contact adjusted when testing left and right collisions
  • Spikes and flames take tile height as reference
  • Jellyfish moves faster
  • Now hero falls in small gaps
  • New world view at the beginning of the game (it shows all levels in miniature)
  • Screens code refactored
  • New teleport element 
  • Teleports can be grouped, so one can have many on the same level as long as they are in different groups
  • Hero's immunity activated when entering destination teleport since an enemy can be moving there
  • Princess has more Z priority
  • Crab collision when waking up has been improved
  • Droid laser speed set to 1
  • Droid does not stop when it is closed to tiles (avoiding potential gliches)
  • Hover collision system against tiles improved
  • Hover collision system is now based on physics when colliding with other hovers 
  • Titan collision with enemies improved
  • Start attribute checking, now it checks for no start or more than one start
  • New level The Ending, now is a big maze
  • Moving platforms bottom check fixed
  • Bat collisions improved
  • New game over screen 
  • New stalactite bitmap
  • Fixed a bug when hero was dying and a bubble catch him
  • New waterfall tiles (trying...)


Editor)

  • Grid is visible again

New world presentation


When game is finish, there is also a new presentation


New level for The Ending



Saturday, December 28, 2013

HBF, last 2013 update

Last update of the year, merry Xmas and happy new year!

Binaries and sources can be downloaded at the moment from SugarSync.


Latest changes:

BB)

  • Fixed a memory leak in TSpriteEngine.SpritesAt() when using spatial partitioning
  • New TGraphicDriver.Circle() primitive
  • Fixed a potential memory leak in TCollisionMatrix

HBF)

  • Hover now shows a different animation when colliding
  • Hover was looking for collisions in wrong rectangle
  • Mummy now shows a different animation when jumping
  • Mummy speed is twice as fast
  • Titan now kills non mechanical enemies when rolling over them
  • Bat collision improved
  • Fixed a weird move in jellyfish 
  • Blob always jumps to exit from traps
  • Droid laser also kills enemies 
  • Eye laser also kills enemies 
  • Fish now inherits from TBoundingEnemy
  • Flame now behaves like the spike (hides and shows)
  • New enemy Hooper 
  • New door bitmaps
  • New enemy hooper
  • New map Colors 
  • Spike bitmap shrink a bit
  • Spikes can now be reversed (top to bottom)
  • Sounds emitted outside hero's range are discarded
  • Explosions and blood die animations last longer
  • CorrectGravityOrientation() now properly adjusts the angle to the distance of the target tile
  • Now hero is in front of the ladders in the darkness level
  • Hero dies in a different way (BTW still not sure)
  • Minor map changes
  • ApplyGravity property removed, added Gravity.gNone
  • Platforms now use the bouncing properties (I'd lost that change in the hard disc failure and hadn't notice it)

New level Colors



Entering a new level


Sunday, December 15, 2013

Avoiding too much memory consumption

I realize that HBF was consuming too much memory so I tried the following approaches:

  • Avoiding in main classes the creation of internal classes until they are needed (the so called lazy initialization), since in most cases it's not mandatory to use them at all, for example one can freely assign any kind of value to sprites via GetVar/SetVar, but this is only used in a few classes. Another example is the use of distortions, currently they are only used with the grass element, so any other class doesn't need these distortions.
  • Create something that loads the bitmaps on demand (before all bitmaps were loaded), therefore TAnimationOptimizer was created, no code has to be changed with this approach, just wrap the assignation of animation via this class
Binaries and sources can be downloaded at the moment from SugarSync.

So what's new?





BB)
Avoiding early creation of aditional classes when creating sprites (vars, triggers and distortions)
More lazy creation approach on TCollision and TComponentEx (avoiding creation of internal classes when not used)
FillSurface() and DoColorKey() in D3D optimized a bit
Die event can be also assigned via closures (very handy)
New random methods based on KISS RNG
Some TLayer scan functions optimized a bit
New TSpriteEngine CountClasses() method (avoids the creation of a list like in Find() )
Laser beam didn't have assigned the camera so it was not shown
Fixed some overflow sound volume and panning issues

HBF)
Spike fixed (once for all?)
Avoiding early creation of lightmaps (darkness, etc)
New element princess (guess for what...)
There is a new animation optimizer so the system knows when to load animation bitmaps, just call TAnimationOptimizer.Instance.Get(), now the game does not load all graphics at the beginning
New element black hole (experimental)
Map folders renamed
New EnemyType property, removed IsMechanic and Indestructible properties (when Indestructible, hero's shield cannot kill the enemy)
Hero now has a limited amount of air under the water (in percentage), the water level has some escapes to get extra air
Memory leak in darkness fixed
Arrows now explode bubbles
Some entities no do longer generate shadows
Calls to Engine.Find() changed to Engine.SpritesAt() which uses the spational partitioning and therefore it is much faster
New map called "No name" based on bubbles
Enemies on top of Items won't try to move left and right all the time as if there was no tomorrow
New TGameSprite helper methods IsBall(item): bool and IsBubble(item): bool
New element door (it didn't need to be an item), Items should be very simple sprites that can interact with normal sprites
When Ball collides against a tile it stops (last level contains one)
New bubbles element
Keys, lives and princess created when needed
HandleSprings() refactored and renamed to GetJumpMultiplicator()
New class THud that does all the job related to displaying lives, key, etc
New enemy Tom
New images for Mummy
Bubbles were generating memory leak (what's wrong with me?!)
Bubbles now collide against solid tiles
Flame kills hero
Weird now tries to connect to the closer wall when instantiated
Trap door adds a delay for every instance, this way the doors are not synchronized therefore it looks nicer

Mummy and new bubbles


Air vents


Our new friend Tom, well I guess it should be bigger...


Friday, December 13, 2013

Observer and Observable

In BB framework what to do when there is a relationship between entities and one of them dies?

TDummySprite inherits from TComponentEx which implements the Observable/Observer pattern.

So for example bubbles are solid temporally so any enemy or hero itself can be on top of them, but since a  bubble can suddenly explode, the sprites needs to be informed in order to remove the reference, this is how I did it:

procedure TGameSprite.SetCarryTile(aTile: ISprite);
begin
  if FCarryTile = aTile then
    Exit;

  TriggerSpring(aTile);
  TriggerBalls(aTile);
  StopJumping;

  if aTile <> nil then
  begin
    //So for instance if a sprite is on top of a bubble and this bubble explodes (it dies), sprite is informed and can react
    (aTile as IObservable).AddObserver(self);

    Y := GetContactPlatformY(Gravity, aTile);
    if Gravity = gDown then
      Y := Y - Height;

    if State = ssFalling then
      State := ssWalking;
  end else
  begin
    HorizontalSpeed := 0;
    VerticalSpeed := 0;

    RestoreSpeeds;
  end;

  FCarryTile := aTile;
end;

And then override the method Update()
procedure TGameSprite.Update(aMessage: TMessage);
begin
  inherited;

  if aMessage.Sender = CarryTile as TObject then
    CarryTile := nil;
end;

And there you can update your pointer to nil.

Saturday, November 30, 2013

New darkness generator

Main improvements are new spatial partitioning, new darkness generator and the decoupling of the 2d camera.

Binaries and sources can be downloaded at the moment from SugarSync.

So what's new?

BB)
  • Buffer.Use() was used too early causing errors in 3d stuff
  • New class TCamera2D, it has been decoupled from TLayer.
  • TEnts new overloaded Load() method for streams
  • Layer and Sprites now can use the 2d camera
  • Polygons can now be set to the sortered buffer list
  • Removed any coordinate information from TLayer 
  • Sprites have a new property called ParallaxId, which can be set manually or automatically by the rendering layer 
  • Class TCollisionMatridx, implements spacial partitioning for easy retrieving of sprites at a certain position
  • Fixed rare memory errors in TSpriteEngine.Render() when killing entities
  • TLaser did not call Clear() before being freed (since is not a TSprite descendant) creating some memory leaks
  • Fixed a bug when a sprite had shadows and index was 0 (-0 = 0)
  • Tiles in maps can cast shadows
  • Engine 3d code cleaned a bit (long time...)
  • TLayer.ScanAttributes can be now set to a certain window (so not the whole map has to be scanned)
  • TSurface.Blit() heavily improved since it is the base for darkness
  • New TMem.Move32()

HBF)
  • Hero dies in a different way (not sure if I like it)
  • Fixed error in AdjustToLeftTile()
  • Stalactite now explodes when collisioning with shield (very realistic...)
  • Cannon is now set to mechanic
  • Fixed minor bug when pausing Spikeball
  • New backgrounds
  • Droid has a new sound 
  • Some 3d stuff is now shown in menus
  • All necessary changes for using new 2d camera were applied
  • VerticalVelocity renamed to Impulse
  • Explosion does not longer kill hero
  • Fixed bug with fishes that were facing none status
  • Fireballs in fire wheels are no longer TGameSprite but TNonGravityEnemy
  • Tiles now cast shadows
  • Fixed the spikes collisions (not working 100% yet)
  • Fixed a bug where game could not be continued more than once in the same level
  • Ending menu loads resources when needed
  • TBird was immortal...
  • Darkness is now generated in real time, showing also light emitted from different objects (candles, fire, etc)
  • New attribute ATTR_FIRE (serve as dying flag and light emitter for darkness)

Editor)
  • Updated with camera stuff

Demos)
  • Code cleaned a bit

This is the new darkness generator



Wednesday, November 20, 2013

ChessKISS amateur division

Looks like ChessKISS did a good job this time, became third with same points than second and two points behind the winner.

Final Standings

34.0 - Waxman 2013

32.0 - ECE 12.01
32.0 - ChessKiss 1.7 64-bit
32.0 - Mediocre 0.5
30.5 - Absolute Zero 2.1.1.0
29.5 - Butcher 1.64 64-bit
28.5 - Bagatur 1.3a 64-bit
26.5 - Gibbon 2.57a 64-bit
25.0 - FireFly 2.6.0 64-bit
24.5 - Fischerle 0.9.30b
21.0 - MadChess 1.3 64-bit
20.5 - ProChess 1.02AD
17.5 - Carballo 0.8
10.5 - K2 0.35

http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?t=7200

Binaries and sources can be downloaded at the moment from SugarSync.

Saturday, November 16, 2013

Time to profile

Main change is the ability to start from an already played level

Binaries and sources can be downloaded at the moment from SugarSync, from readme:

BB)

  • New pendulum.fix property
  • New TSurface.StarBurst()
  • System now decides when a buffer will need to be sorted (done via alpha, colorkey or 32 bits surface)
  • Shadows are now also cached (performance boost )
  • View in TLayer is now initialized on creation
  • Hash buffers optimized for 32 bits (before they were UINT64)
  • Fixed an rare bug with the D3D stage codes
  • The engine is able to load 32 bits image with different alpha and show them properly
  • New Layer RemoveItemsAt() and RemoveAnimationsAt() functions
  • BuffersToBeRemoved removed
  • Fixed minor issues with SeamlessX/SeamLessY 
  • Filenames in bigfile are now encrypted


HBF)

  • New method TGameSprite.Jump() (makes coding easier)
  • Mummy now jumps over dying attributes
  • Spike ball is able to stand fixed when in 90 degrees and some solid blocks 
  • New screen when entering levels (starburst effect )
  • Some stuff shown in special views is cleared per level and not keep it for the whole game (memory optimization)
  • New enemy droid
  • Eye laser can break walls when they are breakable
  • Rain and snow were adding double amount of items
  • Arrows were taking candidate enemies from the hero view, when they have to take enemies from their own view
  • Pickups, arrows, grass, spike and spotlight cast shadows
  • When a time pickup is taken, Spotlight is also paused 
  • Refactored coding for screens renders
  • FireWheel is shown with proper Z
  • New experimental wall element
  • Some images were 32 bits with no alpha, so they are reduced to 24 bits
  • Mechanic enemies throw explosion when die while normal enemies throw blood 
  • New hero sound when landing 
  • Added profiles, so the player can start from any already played level
  • Fixed some issues when dying and gravity is reversed
  • Levels can have clouds in parallax (level 6)
  • Fixed error in AdjustToLeftTile()


Editor)

  • Many errors fixed


New enemy droid


Levels can be continued

Parallax clouds


Rotating starburst shown when entering a new level

Saturday, November 2, 2013

The breaking walls and diving version

Trying to create some puzzles via cannon balls and/or spike balls since they can break walls.

Binaries and sources can be downloaded at the moment from SugarSync, from readme:

BB)

  • New class TPendulum in BB.Physics
  • FMUSIC_FreeSong() was not called every time a new song was loaded
  • New TBackground properties SeamlessX and SeamlessY
  • New TSurface.Fire (old skool fire...)
  • New property TSimpleSprite Radious 

HBF)

  • When hero collides with floor, an animation is shown
  • Arrows now can also kill enemies 
  • Collision from enemies to hero's shield are done via Radious 
  • Bat collision was broken for a few releases 
  • Error in gravity when one red light was not painted, the whole system was tagged as "not needed"
  • "Cluod" is able to Flip
  • Hero can now go diving
  • Hero releases bubbles when diving
  • New sea level 12 (previous 12 is now 14)
  • Birds don't appear in water levels (via new map property)
  • Collecting pickups was clearing the cell from the wrong layer
  • New enemy cannon 
  • Hover collides also with other hovers
  • New TGameSprite.ApplyEnvironment, if false no top/bottom collisions are performed
  • Cannon balls explode when hiting a wall
  • Cannon ball can also break walls if they are breakable
  • New property TGameSprite.DieWhenHit
  • New fish enemy called fishi
  • New enemy called froggy
  • New IEnemy.IsMechanic()
  • Arrows can only kill non mechanical enemies 
  • New spike ball that is hanging from ceiling (behaves as a pendulum)
  • Spike ball can break walls
  • Crepuscule is now integrated in the effect dispatcher
  • Scanlines are now integrated in the effect dispatcher
  • TFire is now TFireWheel 
  • New Flame prototype (old skool fire)
  • New dragon enemy (not used yet)
  • New music for level 13

Cannon balls can break some walls



New enemy froggy


New level totally under the water (also new enemy fishi)


New spike balls, beware!