binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2018, 10:56:26 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 ... 26 27 [28] 29 30 ... 165 Go Down Print
Author Topic: The Binary Zoo Bog  (Read 606659 times)
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #405 on: February 06, 2009, 02:28:57 PM »

The Zoo animals are in!  Yes it's nice to get the most important features in first  Kang-a-roo!

The intro is in as well.  It might we worth having a twiddle with the old analogues on that screen Wink

And the proper game state structure is in place so we can easily switch between different screens (intro, menus, game etc) and the various game modes will be handled properly.

And now I can get back to writing a funky new emitter class.....or at least it sounds like a good idea in my head. Time will tell BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #406 on: February 07, 2009, 06:24:51 PM »

A while back you mentioned spriteFonts, I was wondering if this would encompass custom made fonts using MS Paint as an example. I have added Arial for the time being and am currently using tha to display everything. I'd like to add my own font to seperate my Pong game from everyone elses on my course, especially since its assessed work.

I've also decided to leave motion blur til everything else is working.

I was also wondeirng how you would go about making a game structure like the menu, game, game over screen and so on. would you seperate the update method into either Game, Menu and game over then depending on which is true at the time it would change what is being displayed. Other than what I am stuck with at the moment XNA is great!
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #407 on: February 07, 2009, 07:38:48 PM »

A while back you mentioned spriteFonts, I was wondering if this would encompass custom made fonts using MS Paint as an example. I have added Arial for the time being and am currently using tha to display everything. I'd like to add my own font to seperate my Pong game from everyone elses on my course, especially since its assessed work.
Well it's fair to say I've gone overboard with fonts, but I didn't want to be stuck using the built in SpriteFonts as they are rather limiting.

I have a vector font system and I have my "bitmap font" system which I ported from DBPro and I think this is the one you are talking about.

That works pretty much the same as drawing any other sprite would.  Just draw all your characters on a single image (use PNG if you can to get nice alpha effects) and then write a little routine to store Rectangles that contain the co-ordinates of each character on that image.

I'll break that down further if you want.


I've also decided to leave motion blur til everything else is working.
Do Smiley  It's literally a few lines of code that you can just add when you're ready.


I was also wondeirng how you would go about making a game structure like the menu, game, game over screen and so on. would you seperate the update method into either Game, Menu and game over then depending on which is true at the time it would change what is being displayed. Other than what I am stuck with at the moment XNA is great!
Pretty much yes.  There are a lot of clever ways you could do it, but most importantly , pick a system you are comfortable with.  A simple Enumerator to track things is as easy as any;

pseudo again Smiley
Code:
enum GameState
{
MainMenu,
Pause,
Game,
}

GameState CurrentGameState=GameState.MainMenu


Update()
{
   switch (CurrentGameState)
   {
   case GameState.MainMenu:
      {
      if (buttonPressed=="start") CurrentGameState=GameState.Game
      break;
      }
   //add other states
   }
}


Draw()
{
   switch (CurrentGameState)
   {
   case GameState.MainMenu:
      {
      MainMenu.Draw()
      break;
      }
   case GameState.Game:
      {
      Game.Draw()
      break;
      }
   //add other states
   }
}

You get the idea.  BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #408 on: February 08, 2009, 11:14:50 AM »

A while back you mentioned spriteFonts, I was wondering if this would encompass custom made fonts using MS Paint as an example. I have added Arial for the time being and am currently using tha to display everything. I'd like to add my own font to seperate my Pong game from everyone elses on my course, especially since its assessed work.
Well it's fair to say I've gone overboard with fonts, but I didn't want to be stuck using the built in SpriteFonts as they are rather limiting.

I have a vector font system and I have my "bitmap font" system which I ported from DBPro and I think this is the one you are talking about.

That works pretty much the same as drawing any other sprite would.  Just draw all your characters on a single image (use PNG if you can to get nice alpha effects) and then write a little routine to store Rectangles that contain the co-ordinates of each character on that image.

I'll break that down further if you want.

Please do!

I think keeping track of the gamestate shouldn't be too hard. Thanks for your help once again!
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #409 on: February 11, 2009, 08:00:37 PM »

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


Meanwhile...the new emitter code seems to be pretty decent.  The old system was ported from my old DBPro code and while it worked and was fairly efficient performance wise, it wasn't as flexible as I'd like and the code was very fragmented and bloated.

I essentially had separate emitters for FX and bullets and no real emitter functions for enemies or powerups.  Under the new system an emitter can create any of the 4 objects mentioned in any fancy patterns I can think up and all handled pretty much automatically.

Now I just need to tweak my existing bullet, fx, powerup and enemy code to work with these new emitters.  That should be fun  Kang-a-roo!

All rather boring to read about TBH.  I'll post a pic of a stripper or something next time.  BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #410 on: February 11, 2009, 08:12:35 PM »

Lol at the end comment Smiley

I was wondering though. If you make an object, then continue to load the object (texture2D) in this case. How would you then go about making many unique copies of such a thing where each of which can be moved individually...

I'm asking too much.
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #411 on: February 14, 2009, 03:09:40 PM »

I was wondering though. If you make an object, then continue to load the object (texture2D) in this case. How would you then go about making many unique copies of such a thing where each of which can be moved individually...
I'm not sure what the "proper" way is to do it, but I use a fairly simple array to store both my Master entities and my child objects.

My array of Master entities stores all the data associated with each enemy/bullet/fx type.

eg (pseudo):
Code:
master[1].Animation="enemy1";
master[1].Strength=10;
etc.

Then my child object array is used to store all the information for the objects you actually see on screen.

When creating a new object you just pass into the method what object you want to create and where you want it:

more pseudo code:
Code:
CreateObject( objectType , position)
{
   newObject=GetFreeObject(); // find an array index that isn't already "Alive"
   object[newObject].Alive = true;
   object[newObject].Type = objectType;
   object[newObject].Strength = master[objectType].Strength;
   object[newObject].Position = position;
}

As you can see it's not necessary to copy all the Master attributes to the child Objects.  For example the animation will never change so we can just reference the Master objects data if we need that information.

But things like Strength need to be copied to the child object as this will need to change when an enemy is shot for example.

Then other information such as Position doesn't need to be stored in the Master object at all, but is obviously needed for the child object.

That's quite a simplified version of what I really do, but hopefully you get the idea. ( The data for the Master array for example is best stored in an external XML file for easy editing,  and there are a number of different ways you can handle your array of child objects more efficiently using Lists, Stacks etc)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #412 on: February 19, 2009, 03:16:22 PM »

Replacing my existing separate routines for fx, bullets, enemies etc with a single new multi-purpose object is throwing up some interesting possibilities.

No longer do any objects have clear and distinctive behaviours and restrictions.  Every type of object is capable of every type of behaviour or action (if that makes any sense  Tongue )

So for example previous fx particles had no collision routine, but now they can collide and react just like every other object can.  If I wanted explosion fx particles to act more like shrapnel and damage anything they come into contact with then I can. 

And how about crazy stuff like Powerups that fire at you and also have AI so you have to give chase if you want to them? 

Possibilities  BunnyMonkey!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #413 on: February 19, 2009, 05:01:09 PM »

Now that sounds amazing. Scared AI powerups that when you try and collect them, they try and flee! Cool.

I'm currently consolidating like code into suitable methods like what I was doing in the other thread. It means my code is that much better and completely usable for any program. I have got to say though, I love C# !
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #414 on: February 20, 2009, 12:59:45 AM »

Now that sounds amazing. Scared AI powerups that when you try and collect them, they try and flee! Cool.
Well I just threw that out there as a stupid example, but having powerups that you have to chase down could make for a nice strategic dilemma that you don't normally get.  BunnyMonkey!


I'm currently consolidating like code into suitable methods like what I was doing in the other thread. It means my code is that much better and completely usable for any program. I have got to say though, I love C# !
Yeah it's lovely, as is the whole development environment.

And doing these new emitter and object routines, I'm finally feeling confident that I have at least a reasonable clue what I'm doing with OOP, C# and XNA Smiley
Logged

TheKhakinator
Chiptune Wizard
Playtester
1000 XP
*
Offline Offline

Posts: 2888


Grav Corp, Moonfaker.


View Profile WWW
« Reply #415 on: February 20, 2009, 06:33:49 AM »

Now that sounds amazing. Scared AI powerups that when you try and collect them, they try and flee! Cool.
Well I just threw that out there as a stupid example, but having powerups that you have to chase down could make for a nice strategic dilemma that you don't normally get.  BunnyMonkey!

If that doesn't work, just have them try to wriggle away slowly as if they're stuck in mud. That way it wouldn't impede gameplay, but it'd look cute as if they were trying to struggle away helplessly...
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #416 on: February 20, 2009, 09:48:12 AM »

Quote
And how about crazy stuff like Powerups that fire at you and also have AI so you have to give chase if you want to them? 


Yeh, that does sound cool.

Great to see your're making good progress with the new dev system.

TMC
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #417 on: February 20, 2009, 12:15:56 PM »

Now that sounds amazing. Scared AI powerups that when you try and collect them, they try and flee! Cool.
Well I just threw that out there as a stupid example, but having powerups that you have to chase down could make for a nice strategic dilemma that you don't normally get.  BunnyMonkey!

If that doesn't work, just have them try to wriggle away slowly as if they're stuck in mud. That way it wouldn't impede gameplay, but it'd look cute as if they were trying to struggle away helplessly...
We don't do "cute"  Grin

Next task is to link in my existing vector line code with the new object/emitter system.  That way I'm not just restricted to images for objects, but can use vector line designs and even vector text.  Imagine getting chased by a "You suck!" missile  BunnyMonkey!
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #418 on: February 21, 2009, 02:10:55 PM »

Been doing a little work on my vector text editor.  It was originally designed just to handle designing vector fonts so was pretty basic, but now I've adding the option to use vector stuff for other objects so I'm making a few tweaks to make it more flexible.  Still nothing too fancy, but it now handles different coloured lines and alpha settings within thee same character/object.  Plus I've increased the resolution of the grid of points you draw on to allow for slightly more complicated shapes.

Then I need a couple of tweaks to the game engines vector drawing code to handle these additional features. I'm quite looking forward to seeing it in action Smiley
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #419 on: February 22, 2009, 02:01:52 PM »

So, you have entered the world of useful editors aswell Fog? That sounds like some advanced stuff. I'm definitly keeping a watchful eye on your progress as it seems you've managed to do more work in XNA than you did on Tension, which i'm sure your going to want to complete after you port/improve Mono, Echoes, Crack and many more...

I've only just managed to get used to "structs" and I love them. I do however need to learn how to understand classes which as a juxtaposition I don't really enjoy at all.

Oh and I managed to fix a glitch in Fireworks which was preventing me from pushing it out to test. So maybe by tonight i'll have it sent to both TMC and yourself!
Logged
Pages: 1 ... 26 27 [28] 29 30 ... 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!