binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 18, 2018, 05:17:29 PM

Login with username, password and session length
Search:     Advanced search
30168 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 ... 12 13 [14] 15 16 ... 164 Go Down Print
Author Topic: The Binary Zoo Bog  (Read 605817 times)
JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2420


View Profile
« Reply #195 on: March 28, 2008, 12:03:33 PM »

Great news fog.

Now that is a big leap ! Infact I am really surprised with that. Great stuff though, I can't wait to play Mono on 360...With a 360 controller, over live, team based games, leaderboards !! Its like a dream come true, I could just be in the Twilight Zone...but I doubt.

No leaderboards in XNA.

You serious, shame...
Logged
Lyx
Guest
« Reply #196 on: March 28, 2008, 01:49:16 PM »

It's not only a new language for me to learn, it's a whole different way of coding.  I've never done anything OOP related so there's obviously something of a learning curve here.
To get a general grasp of OOP, i'd propose to first train with a few "Self" tutorials. However, the downside is that after you "get it", you may hate the current class-based languages for being unnecessarily complex (Self uses prototypes instead of classes - so, a more "pure" OOP-approach).

In short, the difference between prototype-based OOP and class-based OOP is this:

With a class-based language, there are only factories and products. Factories can only produce products and do nothing else. Products can have variables (attributes) and functions (methods). New products (instances) can only come from factories (classes). So, the entire programming environment is strictly divided (i'd call it shizophrenetic). If you need a new kind of product, you first need to create a factory for it, even if you need only one single product of this kind.

With prototype-based programming, there is no such kind of general seperation. There are just objects, which can contain vars and functions and which can do stuff. If you need more objects of the same kind, then you just copy it, and thats it.

- Lyx
« Last Edit: March 28, 2008, 01:55:19 PM by Lyx » Logged
TheKhakinator
Chiptune Wizard
Playtester
1000 XP
*
Offline Offline

Posts: 2886


Grav Corp, Moonfaker.


View Profile WWW
« Reply #197 on: March 28, 2008, 03:47:40 PM »

It'll be interesting to see this stuff, always expanding it seems lol.

Of course, I'll just make one post full of tears if your first 360 exclusive comes out before I get a 360 Tongue (Though I assume you wouldn't just ditch us all... right? Right?) 
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #198 on: March 28, 2008, 05:08:11 PM »

Cheers for the comments and advice guys.  I didn't know anyone was reading this so I guess those updates better be more regular ;P

It'll be interesting to see this stuff, always expanding it seems lol.

Of course, I'll just make one post full of tears if your first 360 exclusive comes out before I get a 360 Tongue (Though I assume you wouldn't just ditch us all... right? Right?) 
If you're prepared to do a little installing then the PC version will still come out at the same time if not sooner than the 360 one Wink

XNA is far from perfect yet from what I've read on different forums but it is evolving really quickly and they do seem to be listening to developers concerns and improving or adding functionality where necessary.  As a developer that can only fill you with confidence for the future.

The only actual examples of XNA I've seen are the couple Paul has done and that was enough to convince me.  Obviously it will take me some time to get to that level (if ever) but it's more than enough inspiration.



BunnyMonkeys Adventures in XNA : Day 1

I haven't really done any coding as such yet as I've been familiarising myself with Visual Studio Express Edition and I must say I like what I've seen so far....even if it is a bit feature packed compared to what I'm used to.  I've always said I'd happily code in Notepad but there are a few things in VS that I can see I'm going to like (I'll comment more when I've had the chance to use them).

Opening up an XNA game template for the first time was quite reassuring though.  Over the last few years of working in BASIC I've changed the way I structure code a hell of a lot just through a gradual learning process.  As it happens the way I ended up structuring everything is almost identical to the way the main game engine works in XNA with separate Initialise, Load, Update and Draw methods/functions, so at least with that aspect of it I feel relatively comfortable.

Anyway where to start? Well it's a good job I said I wasn't going to go down the "Hello World" route as there doesn't seem to be a simple PRINT or TEXT command lol.  I don't use those commands much in games but it is useful to have them for development and debugging purposes so, having found a SpriteFont class, that seems like as good a place to start coding as anywhere.

Logged

Banzai
200 XP
*
Offline Offline

Posts: 202


Duct Tape King

Banzai8th
View Profile Email
« Reply #199 on: March 29, 2008, 04:45:53 AM »

The first game I made in C++ was connect four.
It was a very good first learning program, it touched bases on a lot of concepts without being too complex.
I'd say choose something similar. A very simple game or program that deals with some of the areas you would like to get good at.
Logged

PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #200 on: March 29, 2008, 12:11:09 PM »

Anyway where to start? Well it's a good job I said I wasn't going to go down the "Hello World" route as there doesn't seem to be a simple PRINT or TEXT command lol.  I don't use those commands much in games but it is useful to have them for development and debugging purposes so, having found a SpriteFont class, that seems like as good a place to start coding as anywhere.

Yeah, pass a SpriteFont into SpriteBatch.DrawString for XNA 'Hello World' Smiley

You can also use Console.WriteLine to print some debugging text to Visual Studio's Output window.  Then there's also the Watch and Locals windows for examining the contents of variables.

I'd personally give something like Connect 4 a miss.  Writing stuff like that or Pong or Tetris, etc isn't going to be very fullfilling when he's already got a tip top DBPro engine just waiting for him to get bored of his sexy new XNA mistress.  It's not like it's going to be his first game Smiley 

Get something running on the 360 ASAP because that is what XNA is all about! 
Logged

Cheers,
Paul Cunningham
Pumpkin Games
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #201 on: March 29, 2008, 05:59:59 PM »

The first game I made in C++ was connect four.
It was a very good first learning program, it touched bases on a lot of concepts without being too complex.
I'd say choose something similar. A very simple game or program that deals with some of the areas you would like to get good at.
Like Paul says, if I start on something simple then I'll just get bored and go back to my old DBPro engine where I could be developing proper games.  That's why I'm diving straight into a "proper" game.  It might be a foolish approach but it will at least make it interesting Smiley

Yeah, pass a SpriteFont into SpriteBatch.DrawString for XNA 'Hello World' Smiley
Indeed, we now have basic text. Yay for small milestones. Smiley



Just to start off simply I'm now working on a maths class to fill in some blanks in the existing classes and add a few methods I use regularly.  That seems like a good logical step as I get to write a bunch of methods and properties that I can test using my new Text class without worrying about fancy images and the like just yet.

The first difference I noticed here is that it uses radians and not degrees so that's something I'm going to have to adjust to.  Only a couple of the new methods have proved difficult but that was because I was making them timer related and didn't fully understand how the existing GameTime class worked.  Problem solved now.

Just need to write the Maths Update method now to handle a few things the way I did in DBPro and we can move on.  No doubt I'm making a load of mistakes but I'd rather press on and come back and correct things than spend too long scratching my head over little points.
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2420


View Profile
« Reply #202 on: March 30, 2008, 11:22:59 AM »

Impressive, you've already beaten me with XNA, your getting results almost instantly !

Would you say its worth taking the jump to XNA ? Because I like OOP its just its not very friendly is why i'm scared. I guess it helps that you're a great programmer !

Keep up the god(or good) work, Have you decided which game your gonna port ? I think you should port Crack snce its small, Or Mono because its unique, or Duo cause its unique...infact you should decide...

Best of luck !
Logged
PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #203 on: March 30, 2008, 12:39:02 PM »

Just to start off simply I'm now working on a maths class to fill in some blanks in the existing classes and add a few methods I use regularly.  That seems like a good logical step as I get to write a bunch of methods and properties that I can test using my new Text class without worrying about fancy images and the like just yet.

The first difference I noticed here is that it uses radians and not degrees so that's something I'm going to have to adjust to.  Only a couple of the new methods have proved difficult but that was because I was making them timer related and didn't fully understand how the existing GameTime class worked.  Problem solved now.

Just need to write the Maths Update method now to handle a few things the way I did in DBPro and we can move on.  No doubt I'm making a load of mistakes but I'd rather press on and come back and correct things than spend too long scratching my head over little points.

Check out the MathHelper class too if you haven't already - loads of utility function for converting to and from radians / degrees, lerping between values and some constants for PI, TwoPi, etc.

It's also dead easy to do either variable or fixed step game loops using:

IsFixedTimeStep (on the Game class); true for fixed; false for variable
SynchronizeWithVerticalRetrace (on either Graphics or Graphics device); to sync to v-blank;

There's also a property you can set that determines how often Update is called but I forget what it is now (it defaults to 60 fps so I just left it at that)

And definitely check out Shawn Hargreaves blog.
http://blogs.msdn.com/shawnhar/

It's worth going back to the start and reading them all as there's loads of great tips and tricks in there.  He's really active on the forums too.
http://creators.xna.com/default.aspx

(You probably know those links anyway but just in case)

Logged

Cheers,
Paul Cunningham
Pumpkin Games
EricT
1000 XP
*
Offline Offline

Posts: 1112


I sleep with FOG.

tomassetti13@hotmail.com folkefiendar
View Profile Email
« Reply #204 on: March 30, 2008, 12:46:54 PM »

On the subject of XNA, is there an ETA for XNA with VS2008 support?

MSDN recently sent me a bunch of promo crap for VS2008 (various install discs, free licenses, etc... normal "Hey, if you still like it in a year, pay us $10,000,000 so you can use it till we upgrade in about 6 months). None of the bathroom reading material seems to mention XNA at all in this though, and as far as I knew the last time I read up on it, XNA2.0 is 2005 only.

Hopefully should have a large amount of time in the summer to myself, and possibly, if a certain person who lives 2 floors above me, doesn't book the studio up again completely on my off time, I should be able to start trying this whole "complete a project" thing again.

Edit: Oh, I am aware there are a few unofficial ways to work around into it working, but... I'd prefer an official system personally so when it screws up, I have official people to bitch at, and not some pimply kid who hasn't left his mothers basement since he started programming his uber-awesome MMORPG.
« Last Edit: March 30, 2008, 12:54:34 PM by EricT » Logged

My Achievements Earned:

Sit on my ass and do nothing for 2 hours - CHECK
Stare at a computer screen for more than an hour - CHECK
Ignore those around me for more than 10 hours - CHECK
Kill 2 hookers - 1 To Go
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #205 on: March 30, 2008, 01:41:50 PM »

Would you say its worth taking the jump to XNA ? Because I like OOP its just its not very friendly is why i'm scared. I guess it helps that you're a great programmer !
Well at the risk of repeating myself, I'm nothing more than an average programmer from a technical viewpoint Smiley Game design and coding ability are very different things.

I can't say whether you should use XNA, but if I can get my head around it this quickly with no OOP experience then you shouldn't have any trouble making the jump at all.  I've really got nothing else to compare it with, but Paul can probably give you a better idea of how it compares to other languages and anything important you should be aware of.

Keep up the god(or good) work, Have you decided which game your gonna port ? I think you should port Crack snce its small, Or Mono because its unique, or Duo cause its unique...in fact you should decide...
lol.  That sort of decision is a long long way off.  I don't even know how to do a FOR/NEXT loop yet. Smiley

Check out the MathHelper class too if you haven't already - loads of utility function for converting to and from radians / degrees, lerping between values and some constants for PI, TwoPi, etc.
Yeah I found that after I'd written a bunch of methods that were already in there.   All good practice though  Tongue

It's also dead easy to do either variable or fixed step game loops using:

IsFixedTimeStep (on the Game class); true for fixed; false for variable
SynchronizeWithVerticalRetrace (on either Graphics or Graphics device); to sync to v-blank;
Right, I'm not sure exactly how that would work on a PC with low FPS so I'm going to write everything timer related for now.   That might be the wrong thing to do but that's what I'm used to and I can always change things later.

On the subject of XNA, is there an ETA for XNA with VS2008 support?
XNA 3.0 needs VS2008 and that's due "spring" IIRC.
Logged

PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #206 on: March 30, 2008, 04:08:36 PM »

lol.  That sort of decision is a long long way off.  I don't even know how to do a FOR/NEXT loop yet. Smiley

for (int i = 0; i < someValue; ++i)
{
    this.DoSomething(i);
}

You can also use foreach to iterate over list type things (if they implement certain interfaces).

System.Collections.Generic.List<Alien> myBigListOfAliens = new System.Collections.Generic.List<Alien>();
myBigListOfAliens.Add(new Alien("Fred"));
myBigListOfAliens.Add(new Alien("Bob"));
myBigListOfAliens.Add(new Alien("Jim"));

foreach (Alien myAlien in myBigListOfAliens)
{
    myAlien.AttackPlayer(MASSIVE_DAMAGE);
}

It's all in my book, Become an XNA Expert in 21 days (by Paul Cunningham) available from all good bookstores Smiley

It's also dead easy to do either variable or fixed step game loops using:

IsFixedTimeStep (on the Game class); true for fixed; false for variable
SynchronizeWithVerticalRetrace (on either Graphics or Graphics device); to sync to v-blank;
Right, I'm not sure exactly how that would work on a PC with low FPS so I'm going to write everything timer related for now.   That might be the wrong thing to do but that's what I'm used to and I can always change things later.

I've never really been a fan of timer based loops simply because they are so unpredictable.  I made the switch to fixed after trying to get an alien to zigzag around and he would move wildly different on my fast / slow machines.  My current approach is to tell XNA I want a variable game loop and code my own fixed logic in there.  Gives me more control over what's fixed (all main game objects) and what's not (effects like trails and particles). Rendering is done when all the updates have been done and this could mean 0,1 or more updates between draw calls.  I have to interpolate my last position --> current position to keep things smooth but it means that recordable demos are as simple as saving player keystrokes (and random number seed) and not total object state (I do lose the ability to rewind demos but I can live with that).
« Last Edit: March 30, 2008, 04:13:09 PM by PaulCunningham » Logged

Cheers,
Paul Cunningham
Pumpkin Games
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #207 on: March 30, 2008, 09:44:43 PM »

It's all in my book, Become an XNA Expert in 21 days (by Paul Cunningham) available from all good bookstores Smiley
Release it already Smiley  I could really do with a book that goes beyond the basics and shows things that I otherwise might not stumble across.

It's also dead easy to do either variable or fixed step game loops using:

IsFixedTimeStep (on the Game class); true for fixed; false for variable
SynchronizeWithVerticalRetrace (on either Graphics or Graphics device); to sync to v-blank;
Right, I'm not sure exactly how that would work on a PC with low FPS so I'm going to write everything timer related for now.   That might be the wrong thing to do but that's what I'm used to and I can always change things later.

I've never really been a fan of timer based loops simply because they are so unpredictable.  I made the switch to fixed after trying to get an alien to zigzag around and he would move wildly different on my fast / slow machines.  My current approach is to tell XNA I want a variable game loop and code my own fixed logic in there.  Gives me more control over what's fixed (all main game objects) and what's not (effects like trails and particles). Rendering is done when all the updates have been done and this could mean 0,1 or more updates between draw calls.  I have to interpolate my last position --> current position to keep things smooth but it means that recordable demos are as simple as saving player keystrokes (and random number seed) and not total object state (I do lose the ability to rewind demos but I can live with that).
Hold on, I don't think we are talking about the same thing here.....or rather we are but we are calling them by different names. ;P

When I say timer based code I'm not talking about timer based loops.  I mean calculating everything based on how much time has elapsed regardless of how many loops there have been.  So if an object moves 100 pixels in a second then I use the timer to calculate how far it should have travelled based on elapsed time since the last function/method/whatever call.

That way it doesn't really matter how often XNA calls the various Update & Draw loops, everything should look relatively smooth......which I think is what you meant. Smiley


BunnyMonkey Takes Control - Day 3
Well the text and maths classes are now functional.  (With my definition of "functional" being that I don't know whether they are right but at least they aren't throwing any errors anymore.)

Next up I had a nosey around the input classes and again everything looked pretty straight forward.  I did however decide to write my own classes to arrange the info the existing classes provide in a more usable form.  Again this is no doubt unnecessary but it will make my code easier for me to read and understand and at this stage that's quite important.

So my Mouse class obviously has a bunch of variables to hold the states of the various buttons etc but also handles the drawing of the mouse pointer if required.  Very simple stuff.

Likewise my Joypad class stores the states of every button, trigger and stick and can also be used to trigger a number of set vibration effects.  That's pretty cool and should link well with my FX class when I write that.

All in all, even though the more complicated stuff is still to come, I don't feel that's too bad progress for a few days work. 
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2420


View Profile
« Reply #208 on: March 30, 2008, 09:54:28 PM »

After 3 days of work and you are already on input classes, thats great ! Have you tried loading any images, PNGs JPEGs yet because that always threw me in XNA. I also love the more recent updates ! But I am curious however, why BunnyMonkey ? Also, does this mean that once you get most of the behind the scenes you can start the real work, since luckily for you, most of your media is already there, unless you decide to increase it in resoloution to make it more HD friendly Cheesy.

I am seriously impressed.

As far as books are concerned I have a friend...I say friend a really high ranking person in Microsoft/Lecturer at my local university who has written a handy little book for XNA and game creation. His name is Rob Miles www.robmiles.com check it out, he also runs a blog which he updates regularly.

I can't wait to see what day 4 brings...
Logged
PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #209 on: March 31, 2008, 09:18:18 AM »

Hold on, I don't think we are talking about the same thing here.....or rather we are but we are calling them by different names. ;P

When I say timer based code I'm not talking about timer based loops.  I mean calculating everything based on how much time has elapsed regardless of how many loops there have been.  So if an object moves 100 pixels in a second then I use the timer to calculate how far it should have travelled based on elapsed time since the last function/method/whatever call.

That way it doesn't really matter how often XNA calls the various Update & Draw loops, everything should look relatively smooth......which I think is what you meant. Smiley

Nah, we are talking about different things (I think).  The key is the 100 pixels per second.  My code has no concept of 'per second'.

I'm guessing you have code that does this sort of thing...

position += velocity * time since the last function/method/whatever.

Whereas my movement code is simply...

position += velocity.

What happens if drawing takes longer than 16.7 milliseconds (60 fps)?  I simply run through the update process again.  Now obviously this could result in cases where there are a different number of update calls called between draw calls so my movement would look jerky.  To stop this I have to do...

this.currentState = this.prevousState;
this.currentState = get new current state (movement, rotation, scalling, etc)
this.renderState = interpolate between previous and current states using the amount of 'left over frame time'


Here's the Flipcode artilce from way back that I based my loop on...
http://www.flipcode.com/archives/Main_Loop_with_Fixed_Time_Steps.shtml

Unfortunately due to the death of Flipcode the nested comments seem to have gone Sad

You seem to be taking to this XNA malarky like a duck to water. Nice one Smiley

Tip of the day!  Ensure you set compression to on in your XACT audio project - I went from 33 megs to 4! on the XBox and 8 on Windows doing this Smiley
http://blogs.msdn.com/mitchw/archive/2007/04/27/audio-compression-using-xact.aspx
Logged

Cheers,
Paul Cunningham
Pumpkin Games
Pages: 1 ... 12 13 [14] 15 16 ... 164 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!