Re: Slowness!
- From: "Antoine" <mail@xxxxxxxxxxxxx>
- Date: 5 Jan 2006 12:51:40 -0800
Alistair Hutton wrote:
> On 1 Jan 2006 09:20:57 -0800, "Pedro Gómez-Esteban"
> <pedro.gomez.esteban@xxxxxxxxx> wrote:
>
> >Thanks to all who've replied! I am using the python profiler - and
> >found a couple of methods that are using a *lot* more CPU time than I
> >expected...and also, I am probably dumping my home-made super-precise
> >LOS algorithm for a simpler one (like Angband's) that takes less time.
> >I will stick with Python until I feel the code is as fast as I can make
> >it, and if that's not enough, I'll switch to something else.
> >
>
> Stiuck with it man, I'm curerently writing overhead 2d shooter (with
> random level generation, which is why I'm reading this news group) in
> Python. The game runs at a steady 45 frames a second even with a
> super-precise LOS algorithm, multiple transparency effects and dozens
> of enemies. As other people have pointed out you can rewrite the most
> used portions in C however, good design and appreciation of algrithms
> and computing fundamnetals will see you further. One of the most
> basic maxims to keep in mind is that you can almost always trade
> space for time. Recently I doubled the amount of memory I used to
> store the map tiles to gain 5 FPS.
Agreed. Python will do the job - providing you profile thoroughly, and
use good algorithms (especially for LOS & pathfinding) and efficient
screen blitting.
Re your LOS algorithm... here you may be able to get a manyfold
improvement in speed at the cost of a small loss of performance. My
advice, FWIW, is to use a well established algorithm and precalculate
as much stuff as possible.
I've just spent a few hours adding GUI features to my Python roguelike.
I'm using Pygame and have now added in the GUI tools from PGU, which
gives me various widgets like dialog boxes, scrollboxes, checkboxes and
whatnot. Took a bit of getting my head around but definitely improves
the look and feel.
A.
.
- References:
- Re: Slowness!
- From: Krice
- Re: Slowness!
- From: Pedro Gómez-Esteban
- Re: Slowness!
- From: Alistair Hutton
- Re: Slowness!
- Prev by Date: Yet another fledgling roguelike...QuestRL
- Next by Date: Re: Yet another fledgling roguelike...QuestRL
- Previous by thread: Re: Slowness!
- Next by thread: Re: Slowness!
- Index(es):
Relevant Pages
|