|
  
|
|
|||||||
| Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#61 (permalink) |
|
Zuner
Join Date: Dec 2007
Posts: 56
Reputation: 26
|
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. |
|
|
|
|
|
#62 (permalink) | |
|
Senior Zuner
|
Quote:
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
|
#63 (permalink) | |
|
Zuner
Join Date: Dec 2007
Posts: 56
Reputation: 26
|
Quote:
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();
}
}
}
Code:
Components.Add(new FrameRateCounter(this)); |
|
|
|
|
|
|
#64 (permalink) |
|
Senior Zuner
|
Ok.. that's pretty simple to do. I"ll post back the fps in 5 minutes.
I just learned something new today. YAY
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#65 (permalink) |
|
Jr. Member
Join Date: May 2008
Posts: 410
Reputation: 60
|
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/
|
|
|
|
|
|
#66 (permalink) |
|
Senior Zuner
|
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.
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#67 (permalink) |
|
Jr. Member
Join Date: May 2008
Posts: 410
Reputation: 60
|
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.
![]() |
|
|
|
|
|
#68 (permalink) |
|
Senior Zuner
|
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.
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by jackluo923 : 06-19-2008 at 01:42 PM. ![]() |
|
|
|
|
|
#70 (permalink) |
|
Senior Zuner
|
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.
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#71 (permalink) |
|
Jr. Member
Join Date: May 2008
Posts: 410
Reputation: 60
|
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.
|
|
|
|
![]() |
| Thread Tools | |
|
|
| |