Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions

Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related.

Reply
 
LinkBack Thread Tools
Old 06-18-2008, 02:26 PM   #61 (permalink)
Zuner
 
Join Date: Dec 2007
Posts: 74
sableholic is on a distinguished road
Default

Quote:
Originally Posted by jackluo923 View Post
How do I add a framerate counter?
I used this :
http://blogs.msdn.com/shawnhar/archi...framerate.aspx
as a starting point. You have to change it, for example remove the loadAllContent checks and change the LoadGraphicsContent and Unload one to just LoadContent() methods. Also have to add Content.RootDirectory = "Content" to the constructor.

Last edited by sableholic; 06-18-2008 at 02:45 PM.



sableholic is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 06-18-2008, 02:51 PM   #62 (permalink)
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,293
jackluo923 has a spectacular aura aboutjackluo923 has a spectacular aura about
Send a message via MSN to jackluo923
Default

Quote:
Originally Posted by sableholic View Post
I used this :
http://blogs.msdn.com/shawnhar/archi...framerate.aspx
as a starting point. You have to change it, for example remove the loadAllContent checks and change the LoadGraphicsContent and Unload one to just LoadContent() methods. Also have to add Content.RootDirectory = "Content" to the constructor.
Is it possible if you could just send the copy of game source code you have to me? I'm new to VS and XNA games studio.




jackluo923 is offline   Reply With Quote
Old 06-18-2008, 03:24 PM   #63 (permalink)
Zuner
 
Join Date: Dec 2007
Posts: 74
sableholic is on a distinguished road
Default

Quote:
Originally Posted by jackluo923 View Post
Is it possible if you could just send the copy of game source code you have to me? I'm new to VS and XNA games studio.
Right Click the RaycasterXDemo [Zune] Project and choose Add->New Item->C# Class File
Rename it to FrameRateCounter.cs
Open that file and select all and then paste in the following:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace RaycasterXDemo
{
    public class FrameRateCounter : DrawableGameComponent
    {
        ContentManager Content;
        SpriteBatch spriteBatch;
        SpriteFont spriteFont;

        int frameRate = 0;
        int frameCounter = 0;
        TimeSpan elapsedTime = TimeSpan.Zero;


        public FrameRateCounter(Game game)
            : base(game)
        {
            Content = new ContentManager(game.Services);
            Content.RootDirectory = "Content";
        }


        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteFont = Content.Load<SpriteFont>("Fonts\Font");
        }


        protected override void UnloadContent()
        {
            Content.Unload();
        }


        public override void Update(GameTime gameTime)
        {
            elapsedTime += gameTime.ElapsedGameTime;

            if (elapsedTime > TimeSpan.FromSeconds(1))
            {
                elapsedTime -= TimeSpan.FromSeconds(1);
                frameRate = frameCounter;
                frameCounter = 0;
            }
        }


        public override void Draw(GameTime gameTime)
        {
            frameCounter++;

            string fps = string.Format("fps: {0}", frameRate);

            spriteBatch.Begin();

            spriteBatch.DrawString(spriteFont, fps, new Vector2(33, 33), Color.Black);
            spriteBatch.DrawString(spriteFont, fps, new Vector2(32, 32), Color.White);

            spriteBatch.End();
        }
    }
}
and save it. Then open up Game1.cs and add the following line:
Code:
            Components.Add(new FrameRateCounter(this));
after the Content.RootDirectory = "Content"; line



sableholic is offline   Reply With Quote
Old 06-18-2008, 03:30 PM   #64 (permalink)
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,293
jackluo923 has a spectacular aura aboutjackluo923 has a spectacular aura about
Send a message via MSN to jackluo923
Default

Ok.. that's pretty simple to do. I"ll post back the fps in 5 minutes.
I just learned something new today. YAY




jackluo923 is offline   Reply With Quote
Old 06-18-2008, 04:06 PM   #65 (permalink)
Jr. Member
 
SimReality's Avatar
 
Join Date: May 2008
Posts: 410
SimReality will become famous soon enough
Default

I know this isn't related to the Zune, but I figured some of you might like this: http://nick.gravelyn.com/2008/06/18/...-in-three-dee/



SimReality is offline   Reply With Quote
Old 06-19-2008, 01:25 PM   #66 (permalink)
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,293
jackluo923 has a spectacular aura aboutjackluo923 has a spectacular aura about
Send a message via MSN to jackluo923
Default

Nice, but even the raycasting engine runs faster on the zune compare to silver light. I might be that my comptuer is too slow though.




jackluo923 is offline   Reply With Quote
Old 06-19-2008, 01:34 PM   #67 (permalink)
Jr. Member
 
SimReality's Avatar
 
Join Date: May 2008
Posts: 410
SimReality will become famous soon enough
Default

Beats me. Silverlight is more event-driven than XNA, plus it doesn't get full hardware power and all the other things. But it seems rather close to the Zune (at least my 8GB) that it was worth porting. Maybe I'll make a Silverlight maze game like your Zune game.



SimReality is offline   Reply With Quote
Old 06-19-2008, 01:39 PM   #68 (permalink)
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,293
jackluo923 has a spectacular aura aboutjackluo923 has a spectacular aura about
Send a message via MSN to jackluo923
Default

Wow.. i never knew 8GB zune was that slow. Do you need a map generating tool for the maze?

Also, I think i'm gona delay the release of the maze game. I think i'll add the zuneblade into this game so I can make different levels for the game while listening to some music. The problem is that I don't know how to get the zuneblade into this game and how to add levels. So i'll have to seek help from other developers from zuneboards.

Last edited by jackluo923; 06-19-2008 at 01:42 PM.




jackluo923 is offline   Reply With Quote
Old 06-19-2008, 02:29 PM   #69 (permalink)
Zuner
 
Join Date: Dec 2007
Posts: 74
sableholic is on a distinguished road
Default

Jackluo what kind of fps are you experiencing on your Zune 30?



sableholic is offline   Reply With Quote
Old 06-19-2008, 02:41 PM   #70 (permalink)
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,293
jackluo923 has a spectacular aura aboutjackluo923 has a spectacular aura about
Send a message via MSN to jackluo923
Default

I found out a trick for optimizing the FPS. If you create the sprites bigger, like 300pixel length and width.. etc, it won't lag.

Anyways... with 2-3 large sprites, It's impossible for me to get it to lag I don't know the exact fps because the fpscounter doesn't work for me or I've done something wrong. When I have about 50 sprites showing at a time, it's pretty choppy (10fps~) for half a second before everything goes smooth again.




jackluo923 is offline   Reply With Quote
Old 06-21-2008, 11:01 AM   #71 (permalink)
Jr. Member
 
SimReality's Avatar
 
Join Date: May 2008
Posts: 410
SimReality will become famous soon enough
Default

There's a new download in the Source Code area for RaycasterX that includes some changes. It seemed (though I didn't test that thoroughly nor really measure the FPS) to help out on my 8GB Zune by moving all the math to Update instead of Draw. So anyone building with RaycasterX will likely want to update to the new version found here: http://www.codeplex.com/raycasterx/S...leCommits.aspx.



SimReality is offline   Reply With Quote
Old 07-13-2009, 08:03 AM   #72 (permalink)
Jr. Zuner
 
Join Date: Oct 2008
Posts: 35
Maxassin has a little shameless behaviour in the past
Default

Hey. I have a (hopefully) related set of questions.

1) What kinds of files could I use for gun animations?

2) Does anyone want to help me make my ZPortal3D game using RaycasterX (seeing as i'm a n00b to raycaster (and c#))

#EDIT#
Oh yeah, just to show you how powerful the engine actually is. On the Zune. My average FPS is 20. Best is 29. On Halo Custom Edition , Runing a blank map, on a machine about 100 (?) times the size of zune my best was 67 and average was 60. that is a performance lapse meaning the Zune is better than my machine by about 20/60=1/3. The zune has 2/3rds of the performance of a machine 100 times the size of the zune. AND the zune is a 4GB! ZOMG

Last edited by Maxassin; 07-13-2009 at 08:31 AM. Reason: 1 thing I had to say



Maxassin is offline   Reply With Quote
Old 07-13-2009, 10:03 AM   #73 (permalink)
Gow
<none>
Premium Member
Administrator
Expert Zuner
 
Gow's Avatar
 
Join Date: Jan 2007
Location: Fort Wayne, IN, USA
Posts: 2,901
Gow has a brilliant futureGow has a brilliant futureGow has a brilliant futureGow has a brilliant futureGow has a brilliant futureGow has a brilliant futureGow has a brilliant futureGow has a brilliant future
Send a message via AIM to Gow Send a message via MSN to Gow Send a message via Skype™ to Gow
Default

Max, you might want to create a new thread and post that. Might get some fresh eyes on it instead of people who will pass over this older thread.
__________________







Gow is offline   Reply With Quote
Old 07-13-2009, 10:36 AM   #74 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 808
Tiptup300 has disabled reputation
Default

Quote:
Originally Posted by Maxassin View Post
Hey. I have a (hopefully) related set of questions.

1) What kinds of files could I use for gun animations?

2) Does anyone want to help me make my ZPortal3D game using RaycasterX (seeing as i'm a n00b to raycaster (and c#))

#EDIT#
Oh yeah, just to show you how powerful the engine actually is. On the Zune. My average FPS is 20. Best is 29. On Halo Custom Edition , Runing a blank map, on a machine about 100 (?) times the size of zune my best was 67 and average was 60. that is a performance lapse meaning the Zune is better than my machine by about 20/60=1/3. The zune has 2/3rds of the performance of a machine 100 times the size of the zune. AND the zune is a 4GB! ZOMG
I really hope you're joking. I really hope you just forgot a /sarcasm tag.



Tiptup300 is offline   Reply With Quote
Old 07-13-2009, 10:37 AM   #75 (permalink)
Jr. Zuner
 
Join Date: Oct 2008
Posts: 35
Maxassin has a little shameless behaviour in the past
Default

Quote:
Originally Posted by Gow View Post
Max, you might want to create a new thread and post that. Might get some fresh eyes on it instead of people who will pass over this older thread.
Thanks for giving me some useful advice (instead of giving me penalties for things I've never heard of)

oh, and tiptup, i did not forget a sarcasm tag.



Maxassin is offline   Reply With Quote
Old 07-18-2009, 11:31 AM   #76 (permalink)
Squirt
 
Join Date: Jul 2009
Posts: 13
Ceppers is an unknown quantity at this point
Default !!!!!!!!!!!!!!

DID U FINISH THE FIRST PERSON SHOOTER OR WHAT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



please i would like to know



Ceppers is offline   Reply With Quote
Old 07-19-2009, 07:38 AM   #77 (permalink)
Jr. Zuner
 
Join Date: Oct 2008
Posts: 35
Maxassin has a little shameless behaviour in the past
Default

Quote:
Originally Posted by Ceppers View Post
DID U FINISH THE FIRST PERSON SHOOTER OR WHAT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



please i would like to know
I am still working on it. I need to find the source code for the portal gun. and i need to program controls, And I need to figure out how to make map on raycast, and I will be done.



Maxassin is offline   Reply With Quote
Old 07-30-2009, 12:22 PM   #78 (permalink)
Zuner
 
Join Date: Jun 2008
Posts: 97
seifer93 is on a distinguished road
Default

Quote:
Originally Posted by Maxassin View Post
Hey. I have a (hopefully) related set of questions.

1) What kinds of files could I use for gun animations?

2) Does anyone want to help me make my ZPortal3D game using RaycasterX (seeing as i'm a n00b to raycaster (and c#))

#EDIT#
Oh yeah, just to show you how powerful the engine actually is. On the Zune. My average FPS is 20. Best is 29. On Halo Custom Edition , Runing a blank map, on a machine about 100 (?) times the size of zune my best was 67 and average was 60. that is a performance lapse meaning the Zune is better than my machine by about 20/60=1/3. The zune has 2/3rds of the performance of a machine 100 times the size of the zune. AND the zune is a 4GB! ZOMG
Please excuse me if I'm wrong, but wasn't it determined a long time ago by several professional developers on this site that the Zune is just too slow for Raycasting? I've been on this site since (more or less) the beginning of Zune games and apps, and several people have picked up and put down this project.



seifer93 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools