[Gambas-user] Just some questions to Kevin Fishburne

Kevin Fishburne kevinfishburne at ...1887...
Sun Apr 3 02:58:48 CEST 2011


On 04/01/2011 05:37 AM, Benoît Minisini wrote:
> Hi Kevin,
>
> I make it public, because it's about coding.

Hi Benoît. No prob, I'm always game for questions. :)

> It is just a few remarks/questions about your game:
>
> 1) Why do you want to rotate the game background? It will be always too slow
> until you rewrite everything using OpenGL, so I suggest you drop that idea
> meanwhile.

The game was originally envisioned to allow that degree of control. I'd 
rather have something that allows first person shooter style controls 
than something that only allows movement like the original Zelda. 
Simultaneously allowing Zelda-style controls with the d-pad and 
movement/orientation controls with dual-analog sticks makes exploration 
and combat flexible, deep, yet still accessible by newbies.

I currently have it set up to do the rotate method only if the player's 
orientation is <> 0, so I can still have everything fully functioning 
without a terrible frame rate all the time. I also have a "savings fund" 
for whoever eventually implements the rotate method in SDL/OpenGL, which 
is in much need of some love.

> 2) You asked for a DrawAlpha() method for compositing different ground layers
> while cutting them up as far as I understood. Am I right? In that case, why
> don't you pre-computed all these layers, so that you don't have to do that
> during the game?

Yes, DrawAlpha is what makes the game's rendering logic possible. 
Without it the game would look like an 80's CRPG...not good.

One reason I don't pre-render is that the game world will be 65536x65536 
tiles server side and 96x96 tiles (at 12288x12288 pixel resolution) 
client side. While there are five "main" layers (bedrock, sand, soil, 
vegetation, snow), each of these layers is composed of an arbitrary 
number of "sub" layers. There is wet sand, dry sand, light vegetation, 
medium vegetation, dense vegetation, etc., for example. So the number of 
12288x12288 resolution layers could be 10+ at 576 MB each. The client 
only knows about 96x96 tiles at any one time, but it keeps an image of a 
smaller subset of those 96x96 tiles (13x13 tiles or 1664x1664 pixels 
when using a screen resolution of 1280x720). The players may also 
permanently modify each of the main layers at any time by digging, or in 
the case of vegetation, by cutting, trampling (walking over) or burning. 
Landscape modifications are shown in real-time and approved/denied, 
stored and rebroadcast to other players by the server.

The good news is that DrawAlpha is fast, is used to draw all visible 
tiles only on the initial render, and subsequent renders only draw new 
"edge" tiles when the player crosses a tile boundary. I'm very happy for 
DrawAlpha to stay the same right now.

> 3) If you don't have to use DrawAlpha() during the game, you will be able to
> use OpenGL very easily I think. Then you will be able to implement the
> rotation very easily too, and the speed will be ok (unless you don't have 3D
> acceleration of course).
>
> Sorry if what I said is out of topic!

I have to use DrawAlpha. It's what allows me to use 4096x4096 pixel 
landscape textures but still have 128x128 pixel tiles. As far as the 
rendering engine is concerned, DrawAlpha is everything.

Right now the only things hurting the frame rate are the rotate method 
and the image-to-image Draw method (image1.Draw[image2,...]). Those 
things can wait, as I'm looking at finishing the game at least a year 
from now...no hurry.

Hope that answers your questions. Now I have to go back to beating my 
head against the wall. ;)

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list