x


Wild fluctuations in performance when built into an exe...

Several of my classmates and I made a platform game in 2 weeks for a small project with Unity.

I used var vert : float = Input.GetAxis("Vertical") * movement_speed; for moving the character around, movement_speed was set to 0.15, and seems to work fine with our animation.

So we get finished and I build it as an exe, my level seems about the same, except I noticed at the very beginning I was moving irregularly fast. However in the next two levels which were a lot smaller then mine the player character could almost fly through at crazy speeds.

I'm sure it's related to the amount of stuff going on in each level, for instance on one of those really fast levels it slows down to normal at the end where there is bunch of spike traps/lights, an overall fairly dense prefab.

So I am wondering how to predict this, or combat this kind of outcome? Or some way to test pre-build if these kinds of problems will arise. We didn't use any objects with crazy vert or polygon counts, and within unity we didn't notice the speed difference at all. I tested the FPS with Fraps (in the exe version) and noticed that it had a large range usually between 50-110, and more like 150 on the smaller levels.

We have a lot of lights & shadows in our levels based on the game's story, I'm wondering if that could be the case but I don't have the experience to know.

more ▼

asked Nov 08 '10 at 08:24 AM

LeviS gravatar image

LeviS
27 5 5 6

I changed all the lights that were Soft Shadows down to No shadows, and while that helped the performance, there is still a large gap in how fast the player moves between the different levels. Is there something I am missing from my movement script to cap the speed?

Nov 08 '10 at 08:56 AM LeviS
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Figured it out. Feel like a fool, I forgot vert *= Time.deltaTime; to make it per second not per frame. And having so many lights casting shadows was a problem too, but now the speed is standardized across levels.

more ▼

answered Nov 08 '10 at 09:10 AM

LeviS gravatar image

LeviS
27 5 5 6

Heh, common mistake. Gl.

Apr 10 '11 at 01:29 AM Joshua
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1197
x677
x504
x370
x34

asked: Nov 08 '10 at 08:24 AM

Seen: 594 times

Last Updated: Nov 08 '10 at 08:24 AM