binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2018, 04:26:41 PM

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 ... 15 16 [17] 18 19 ... 165 Go Down Print
Author Topic: The Binary Zoo Bog  (Read 606781 times)
JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #240 on: April 13, 2008, 10:02:27 AM »

That sounds great ! Do you plan to incorporate joypad vibration into key moments in your games now ? Like when you pick up items or get hit by something ? It is amazing that after 8 days you are on to a winner ! Keep up the good work.
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #241 on: April 13, 2008, 12:02:48 PM »

That sounds great ! Do you plan to incorporate joypad vibration into key moments in your games now ? Like when you pick up items or get hit by something ?
Yes, I've now integrated joypad vibration into my FX code.  This means that when I call an FX of any kind (particle explosion, screen shake etc) , a predefined joypad vibration setting is also triggered automatically.

As this uses XNA though it's possible that this vibration may only work with an XBox360 joypad.  Obviously on the XBox version itself this isn't a problem but it may mean no vibration on the PC version unless you use a 360 pad, but I'll have to test that before I know for sure.
Logged

PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #242 on: April 14, 2008, 09:57:13 AM »

Yup, XInput only works for 360 pads.  You'll have to look at Managed Direct Input if you want to support the rest.  There's a wrapper on SourceForge for it...

http://sourceforge.net/projects/xnadirectinput/

You'll have to redist the Managed Direct X Dlls if you use it and that's where things start to get 'fun'.
Logged

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

Posts: 13185



View Profile WWW Email
« Reply #243 on: April 14, 2008, 03:01:53 PM »

Yup, XInput only works for 360 pads.  You'll have to look at Managed Direct Input if you want to support the rest.  There's a wrapper on SourceForge for it...

http://sourceforge.net/projects/xnadirectinput/

You'll have to redist the Managed Direct X Dlls if you use it and that's where things start to get 'fun'.
Cheers Paul....although I've a feeling your definition of "fun" might be slightly different to mine Smiley
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #244 on: April 14, 2008, 07:28:38 PM »

That sounds great ! Do you plan to incorporate joypad vibration into key moments in your games now ? Like when you pick up items or get hit by something ?
Yes, I've now integrated joypad vibration into my FX code.  This means that when I call an FX of any kind (particle explosion, screen shake etc) , a predefined joypad vibration setting is also triggered automatically.

As this uses XNA though it's possible that this vibration may only work with an XBox360 joypad.  Obviously on the XBox version itself this isn't a problem but it may mean no vibration on the PC version unless you use a 360 pad, but I'll have to test that before I know for sure.

You seem to be doing quite great. you sould add some enemies, bullets and get shooting stuff !
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #245 on: April 15, 2008, 06:12:50 PM »

That sounds great ! Do you plan to incorporate joypad vibration into key moments in your games now ? Like when you pick up items or get hit by something ?
Yes, I've now integrated joypad vibration into my FX code.  This means that when I call an FX of any kind (particle explosion, screen shake etc) , a predefined joypad vibration setting is also triggered automatically.

As this uses XNA though it's possible that this vibration may only work with an XBox360 joypad.  Obviously on the XBox version itself this isn't a problem but it may mean no vibration on the PC version unless you use a 360 pad, but I'll have to test that before I know for sure.

You seem to be doing quite great. you sould add some enemies, bullets and get shooting stuff !
Why didn't I think of that? Smiley

Day 9 - Reinventing the Wheel.
Well it's the sort of thing that was inevitable when you dive in and start coding without doing the minimum of background research first, but it would appear that some of the joypad input code I've written is unnecessary.  Not a huge problem, it still works, and it was all part of the learning process.  For now I'll leave it but it's another thing I'll come back and tidy up at some stage.

More importantly though I've now got the graphical side of my FX code up and running and successfully recreating all the explosion FX etc I had running in Echoes.  Pretty cool. Smiley   At the moment all the FX "scripting" is hard coded whereas in the old game engine it was loaded from an XML file but, as I haven't got any XML code written yet (or any other file code for that matter), it will stay hard coded for now.

Finally feel like I'm making proper progress now.  All the background maths, input, audio etc code is essential but there's nothing quite as satisfying as having something actually on screen....especially when it's lovely neon explosions  Kang-a-roo!
Logged

JDog053
Playtester
1000 XP
*
Offline Offline

Posts: 2421


View Profile
« Reply #246 on: April 15, 2008, 06:24:51 PM »

It just gets better and better, maybe by day 20 you might have a playable build of a game, small as it may. Nah, in all seriousness you are progressing above and beyond what I expected, it gets better the more I read. Do you have a CC membership or are you testing all builds off of your PC whilst using your wired controller ? If so, whats it liek (spelling mistake intentional) ?

Do you know how you are going to add the enemies and add the bullet system like in Mono/Echoes etc. ? Its what i've been wondering since the language isn't friendly.
Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #247 on: April 15, 2008, 09:01:52 PM »

Do you have a CC membership or are you testing all builds off of your PC whilst using your wired controller ? If so, whats it liek (spelling mistake intentional) ?
No CC membership yet so I haven't seen anything on the 360.  I really need to get my old 360 repaired so I can have it next to my PC and use it exclusively for development.  If I rely on the 360 downstairs then I'll have to run up and down stairs during testing and right now with me being ill that's not an option.


Do you know how you are going to add the enemies and add the bullet system like in Mono/Echoes etc. ? Its what i've been wondering since the language isn't friendly.
I don't see why that would be a problem.  Basic enemy and bullet code aren't any more complicated than the FX code I've already got up and running.  Add collisions to those FX particles and they are essentially bullets, and enemy code is essentially the same.

Sure for the enemies I need a chunk of code to handle their different behaviours but code will be little different in XNA to that in BASIC.  They syntax is different but the logic is the same.

Again though the bullet and enemy code in the old engine was all controlled by XML scripts but initially I'll hard code everything.

Day 9 - Additional...
I've just done a proper test on all the FX code and everything hands together well.  One command calls one of the standard FX which creates the particles, plays any necessary sound, and triggers the controller vibration.  The only thing missing from that which I had in the old engine is the ability to trigger a screen effect (screen shaking, flashing etc) so I guess I'll be doing that next. Smiley
Logged

SiN
Escaped from The Zoo
500 XP
*
Offline Offline

Posts: 683


Caffeine Monster Software


View Profile WWW
« Reply #248 on: April 15, 2008, 09:38:04 PM »

FYI fog, XML parsing is totally built into XNA. I believe the class you are looking for is XMLReader, but I could be wrong. And it's mind-numbingly simple to use too! Smiley


Mo
Logged

binary zoo mobile developer | 32x32 . duotrix . geomex . smiley's shooty adventure . by caffeine monster software | my blog
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #249 on: April 15, 2008, 10:51:22 PM »

FYI fog, XML parsing is totally built into XNA. I believe the class you are looking for is XMLReader, but I could be wrong. And it's mind-numbingly simple to use too! Smiley
Cool.  Cheers mate.

I hadn't looked into it myself so assumed I would have to code the whole thing like I had to in DBPro.  The more I see of XNA the more I like it.  Kang-a-roo!
Logged

PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #250 on: April 16, 2008, 11:07:15 AM »

I use the XmlSerializer class - dead easy...

Say I have some class I want to write out to XML.

    [Serializable]
    public class EnvironmentSettings
    {
        public int Width = 1280;
        public int Height = 720;
        public bool FullScreen = true;
    }


Tag it as [Serializable] and expose the data you want to save (the public fields).

Add a method to the class to Save itself (or some other class that deals with loading and saving but you'd have to change the this.GetType() below)

    public void Save(string filename)
    {
            StorageContainer storageContainer = myGame.StorageContainer; //Required for Xbox, not really for Windows.

            using (FileStream fileStream = new FileStream(filename, FileMode.Create))
            {
                System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(this.GetType());
                x.Serialize(fileStream, this);
            }

            storageContainer.Dispose(); //Required for Xbox, not really for Windows.
    }


Easy Peasy.

Loading?

    public static EnvironmentSettings Load(string filename)
        {
            EnvironmentSettings settings = null;

            //Test to see if the file exists.
            //Create a new settings object if not (will have the default values set)
            if (!File.Exists(filename))
                settings = new EnvironmentSettings();

            //Load the settings from the file.
            else
            {
                using (FileStream fileStream = new FileStream(filename, FileMode.Open))
                {
                    System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(EnvironmentSettings));
                    settings = (EnvironmentSettings)x.Deserialize(fileStream);
                }
            }
               
            return settings;
        }


Handles situations where you've added new fields / properties to the class you want to save (e.g. a new feature) but are trying to load an old options file.
Logged

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

Posts: 13185



View Profile WWW Email
« Reply #251 on: April 16, 2008, 09:47:04 PM »

Cheers Paul Smiley

I've just got in having been out all day so wont have a chance to try that until tomorrow, but there are also a few things in there that I haven't come across yet so I need to do a little reading too by the looks of things.
Logged

PaulCunningham
Playtester
200 XP
*
Offline Offline

Posts: 436



View Profile WWW
« Reply #252 on: April 17, 2008, 03:20:59 PM »

I'm guess one of those things is the using statement in that context.

While you've seen it for importing namespaces (using System.IO, etc) used like this it tells the compiler to add code to tidy up the (unmanaged) resources you use.  It wraps your code in a try / finally block and calls Dispose on the object.

A nice little tool is Lutz Roeders Reflector: http://www.aisto.com/roeder/dotnet/.  You can point it at any .Net assembly and it will allow you to decompile the .exe into various source formats (VB.Net, C#, IL).  I used it when I created my sprite drawing stuff to see what SpriteBatch was doing.

Some other nice tools are the CLRProfiler: http://nprof.sourceforge.net/Site/Description.html which will tell you how many heap allocations you have created and when the garbage collector ran.

NProf: http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a-94635beebdda is a pretty good profiler too.

You're probably not really in a position to start using this stuff yet but they are fairly invaluable so file 'em for later Smiley
Logged

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

Posts: 13185



View Profile WWW Email
« Reply #253 on: April 18, 2008, 12:23:42 PM »

Thanks again paul.  I need to create an XNA links thread so all thses useful links don't get burried.
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #254 on: April 20, 2008, 08:43:34 PM »

Day 10 - Toon Toon...

Not much progress to report today as I've been distracted by a certain football game Smiley

I did though get my 2D camera functions working which was something I only recently added to the old DBPro engine, but never got the chance to use (well the last version of Crack I was working on did but nothing I've released).  Of course if I'd done everything in 3D then I wouldn't have to worry about coding a camera as it would all be handled for me by existing commands, but for now I've decided to stick with 2D sprites so I need to handle all the camera operations like panning and rotating myself.

Worth it though as it means I can make levels bigger than the screen dimensions if necessary.  Something like mono wouldn't benefit from that but maybe Echoes would.  I wont know until I try it, but at least the option is there.

Speaking of which I need to decide what game I'm going to work on soon.  I could just keep working on the engine, which will be used for all the games anyway, but I do like to have an idea of where I'm heading and I might as well be building the actual game while I'm testing out all the new code.  I'm still leaning towards mono at the moment.
Logged

Pages: 1 ... 15 16 [17] 18 19 ... 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!