binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 20, 2018, 09:12:33 AM

Login with username, password and session length
Search:     Advanced search
30178 Posts in 1158 Topics by 195 Members
Latest Member: dianeanderson
* Home Help Search Login Register
+  binary zoo
|-+  Binary Zoo
| |-+  Diary of a Game
| | |-+  The Binary Zoo Bog
Pages: 1 ... 28 29 [30] 31 32 ... 165 Go Down Print
Author Topic: The Binary Zoo Bog  (Read 606281 times)
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #435 on: March 07, 2009, 10:52:08 PM »

Emitters everywhere!  Warning: More boring Emitter talk ahead BunnyMonkey!

So all my game objects can now carry up to 3 individually timed emitters which automatically update and, um, emit stuff when necessary.

And as emitter can, um, emit any type of object (such as a bullet, a powerup, a particle fx etc) then that allows for a lot of flexibility.  So in a single enemy object I could use one for exhaust smoke, one for firing a weapon and one to pop out child enemies.  Or, well there are loads of possibilities for future games.

As well as these 3, each object also has two other optional emitters.  One of which is triggered during a collision and one that is triggered when an object is destroyed.

But, I hear you cry (ok, maybe not), what happens if you want your destroyed Asteroid to emit smoke, particles, flames, a powerup and maybe split into smaller Asteroids.  No problem. Each emitter has 10 separate "streams" and each of these can be set to create different patterns of different objects.

And finally, add the fact that any emitter can also call any other emitter then you have a theoretically infinite number to play with on each object.

All of which probably sounds like total unfathomable bollox. 

And now I'm off for a cold shower  BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #436 on: March 08, 2009, 12:04:55 PM »

Yeah that does sound really complicated! I hope your new project uses some of these features as it would be a shame to see it go to waste Smiley.
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #437 on: March 08, 2009, 02:21:20 PM »

Yeah that does sound really complicated! I hope your new project uses some of these features as it would be a shame to see it go to waste Smiley.
Yes and no Smiley 

I'm doing a port of Echoes and I have used the new emitter system to improve the particle effects, but as I'm still keeping it fairly faithful to the PC version and using mostly the same media, I'm not really stretching it.



In other news I hit my first major-ish bug  BunnyMonkey!  I seem to be really lucky when it comes to bugs as other than the odd typo I never get any, so when I fired my code up on the 360 for the first time in a while and it ran at 1 FPS mild panic set in.

And of course in my efforts to isolate the problem I fell for Stupid Coding Errors #1 and immediately made some wrong assumptions  BunnyMonkey!

Because the graphics were running so slow and I'd recently rewritten all the main game graphics code to run off a single spritesheet, it seemed fair to think this is where the problem would lie.  Yet after removing the suspect pieces of code from the compiled version, it was still running as slow as ever.

Then as the mild panic turned to OMFG Houston we have a major problem, I started to worry that it was my new emitter and object code that was the problem.  Jesus if that turned out to be the cause, that would be a hell of a lot of wasted effort.  Needless to say removing that code didn't help either which, although I still had a major bug somewhere, was something of a relief.

Next suspect was, well pretty much any drawing operations that were still left.  Out went the background, the various text routines, the debug text (it was running so slow I certainly didn't need a bloody FPS counter to tell me) and even the screensaver zoo animals were sacrificed.  All I had left was my default image under joypad control.  Did that help? Err, no.

Looking down at what was left of my decimated code there were only a couple of routines left.  So I went through them one at a time until the bleeding bloody obvious struck me.  What the fu......where was the music?  The sound fx were playing fine, but there was no music playing.  Removing that routine seemed to instantly solve the problem.  Nervously I added all the other routines back in and sure enough, everything was running fine.  The continued lack of music drowned out by a stream of expletives.  BunnyMonkey!

The music plays fine on the PC and I still have no idea why it doesn't on the 360, but right now I don't give a toss. All my new graphics routines work great and that's all that matters.

The moral of this story?  I am a bloody idiot.....and don't ever ever ever make assumptions where code is concerned.

</rant>
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #438 on: March 09, 2009, 10:43:58 AM »

Quote
Then as the mild panic turned to OMFG Houston we have a major problem,

lol, that was quite a funny read.  Grin

Yeh, i know exactly where you're coming from.  I've been in many a similar situation, where i sit there and think, how the hell do i track that error down.

Then, like you, when the panic subsides it's usualy a case of methodically remming out code to narrow down the problem.

I had a similar bug this weekend actually.  And like you, it's all ended happily ever after.  Fingers crossed.

The emiters sound like a really flexible system.  Looking forward to seeing it in action.

TMC
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #439 on: March 09, 2009, 02:41:38 PM »

Quote
Then as the mild panic turned to OMFG Houston we have a major problem,

lol, that was quite a funny read.  Grin

After the event I agree Smiley

Anyhoo I found out the problem with the music and it's a known "issue".  It's not a bug as XNA is working as intended, but a quick google shows I'm not the first one to fall foul of it.

Basically in my music update routine I was doing something like this:
Code:
if (MediaPlayer.State == MediaState.Stopped)
{
   MediaPlayer.Play(nextSong);
}
That looks pretty straightforward.  Check to see if the MediaPlayer has stopped playing and if it has then play the next song.  The problem is that there is a slight delay before MediaPlayer starts playing, so in the next update, MediaPlayer still shows as being stopped and so the code attempts to play yet another song.  All these calls to play another song just brings everything to a grinding halt.

So yeah, it was easily fixed, but difficult to find.  BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #440 on: March 12, 2009, 01:44:05 PM »

Quote
Am I the only one that agonizes for ages over which order nested IF statements should be placed for maximum efficiency?  Thought so  Smiley

Not anymore, i've had a few lectures in IF effeciency so now I labour the point aswell. A few well placed IF statements can greatly help to speed up any program.
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #441 on: March 13, 2009, 10:57:45 AM »

Hmm.  Just fixed a bit of a hole in my emitter code.  Essentially I'd forgotten to put a limit on the number of times an emitter can be fired.  Think of it as the number of ammo a gun can hold and you get the idea.  Once the ammo is gone the emitter stops creating new objects.

The oversight became ear shatteringly obvious when testing my static emitter system using a large explosion as a test.  I created the static emitter expecting the large explosion to be created once, but because no limit was specified, it would have happily sat there creating an infinite number of explosions.  Combine that with a 0ms gap between explosions and I'm surprised the eeePC didn't go into meltdown. The tiny speakers certainly didn't enjoy the experience  Tongue

So yeah, emitter shot quantity now capped, static emitters working as intended, and permanent ringing sound in my ears.  BunnyMonkey!
Logged

las6
Escaped from The Zoo
1000 XP
*
Offline Offline

Posts: 1039


creepy!

lauri_suopera@msn.com
View Profile
« Reply #442 on: March 15, 2009, 10:07:20 AM »

The oversight became ear shatteringly obvious when testing my static emitter system using a large explosion as a test.  I created the static emitter expecting the large explosion to be created once, but because no limit was specified, it would have happily sat there creating an infinite number of explosions.  Combine that with a 0ms gap between explosions and I'm surprised the eeePC didn't go into meltdown. The tiny speakers certainly didn't enjoy the experience  Tongue
You should include that as a fps test in the game (in the PC version). Tongue Simply start the infinite explosion and then measure the time/particle count until the fps drops below playable levels. Long times equal higher fx settings.  s-s-snake!
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #443 on: March 15, 2009, 11:55:39 AM »

The oversight became ear shatteringly obvious when testing my static emitter system using a large explosion as a test.  I created the static emitter expecting the large explosion to be created once, but because no limit was specified, it would have happily sat there creating an infinite number of explosions.  Combine that with a 0ms gap between explosions and I'm surprised the eeePC didn't go into meltdown. The tiny speakers certainly didn't enjoy the experience  Tongue
You should include that as a fps test in the game (in the PC version). Tongue Simply start the infinite explosion and then measure the time/particle count until the fps drops below playable levels. Long times equal higher fx settings.  s-s-snake!
Smiley  I see another "because las6 wanted more" FX setting.

TBH watching and listening to all those explosions wasn't a particularly interesting experience, but replacing those explosions with some nice fireworks would be a nice idea.
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #444 on: March 16, 2009, 10:13:48 PM »

Children eh?  Always trouble.  And the least said about parents the better.   BunnyMonkey!

Yes, work on the object parent/child system is slowly taking shape.  That's the way objects relate and react to each other with the moons orbiting around the planets or the snakes of meteors following each other in Echoes being two good examples.

It all sounds relatively simple and for the most part it is, but coding a system flexible enough to handle all the different parent/child relationship types you can think of without overcomplicating things is a bit tricky.  How do you design a system that handles orbits, snakes, swarms, fixed relative positioning etc without having a load of variables and requiring them all to be set properly to achieve even the simplest of effects?  I've no idea.  BunnyMonkey!

Then you need to handle what happens when a parent or child object is killed.  To use an earlier example, what do you do to the child objects in a snake when the head (parent) object is killed.  They would normally just be following the head, so when this is killed you have to change their behaviour somehow.  It's all a bit more complicated than it initially appears BunnyMonkey!

Still, so far so good.  And an added advantage of the new integrated emitter/object system is that these routines aren't restricted to enemies as they were in the old code, but can be used for fx, bullets, powerups or anything else.  Snakes of homing bullets?  Swarms of energy boosting powerups?  Easy.

Or how about combining objects so we have a standard enemy snake, but the last segment is actually a powerup.  Will the player risk trying to collect that or will they take the safe route and destroy the snake and with it the powerup?  Loads of ideas  BunnyMonkey!

Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #445 on: March 17, 2009, 11:02:23 AM »

Cool.

Quote
How do you design a system that handles orbits, snakes, swarms, fixed relative positioning etc without having a load of variables and requiring them all to be set properly to achieve even the simplest of effects?  I've no idea.

Ahh yes.  The coders dilema.  Been there many a time. 
No matter how much pre thought and planning i put into a system, i usually find that during and after coding theres always additions and modifications that need to be made.  Real world testing for me usualy throws up all sorts of unknowns.

Sometimes, i find it's even more efficient not write a catch all routine to handle everthing, but to split the code up into more specific routines.
I'm sure at some future date you'll think of extra additions to make, which makes designing a system now to handle future updates pretty tricky.

Good luck.   Smiley

TMC
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #446 on: March 17, 2009, 04:18:28 PM »

Good luck.   Smiley
Said with years of painful experience lol Smiley

Yeah I'm bound to think of things to add as I go along, however I'm trying to restrict things at the moment to stuff that I need for Echoes.  Luckily, as mentioned earlier, the new system I'm using already offers up a lot more possibilities than the  old one.  And only partly by design  BunnyMonkey!
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #447 on: March 18, 2009, 10:58:58 PM »

Just added a rather lengthy enumerator and code to handle what effect an object can have when it collides with the player.

Initially that sounds fairly short list, with particle fx just passing through and bullets and enemies simply damaging or killing the player, but then you come to powerups.  Even just adding the obvious, run of the mill powerups, we can increase or set player energy levels, add an extra life, add or activate a smart bomb, add a temporary shield, increase or set the players weapon type, extra ammo, extra points, increase the score multiplier etc etc etc.

Anyway with that all now working I've finally ripped out all the old separate fx, bullet, powerup and enemy code.  Most of it had been disabled for a while, but I never felt brave enough to totally remove it just in case the new, replacement emitter and object routines went women's pointy bits up.

And more importantly with all the action and reaction bits and pieces in we can finally play something resembling a game.  A very shit game, but a game none the less.  BunnyMonkey!
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #448 on: March 19, 2009, 08:44:24 PM »

A mini detour today.  I knew I wouldn't be able to get much done so had a little play with some new shaderzzz. 

These are good routines to work on if time is limited because, when sticking to shader 2.0, there is quite a strict limit on the number of calculations each one can have.  Exceed the limit and the thing just wont compile.  It's quite restrictive, but at the same time it encourages some quite creative and efficient coding, so it's something of an enjoyable challenge.

The shaderzzz I did a while back were mainly for use in mono as Echoes doesn't really need any in the main game. (I may add one or two for effect, but they aren't essential).  But the shaderzzz I was working on today will hopefully be unlockable graphical effects linked to completing Zoo Trials in Echoes.

They look fairly good, although I can't promise they will make it any easier to see what is going on  Tongue
Logged

SiN
Escaped from The Zoo
500 XP
*
Offline Offline

Posts: 683


Caffeine Monster Software


View Profile WWW
« Reply #449 on: March 20, 2009, 06:51:24 AM »

They look fairly good, although I can't promise they will make it any easier to see what is going on  Tongue
I would be pretty disappointed if they did. Smiley

Mo
Logged

binary zoo mobile developer | 32x32 . duotrix . geomex . smiley's shooty adventure . by caffeine monster software | my blog
Pages: 1 ... 28 29 [30] 31 32 ... 165 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!