rock E.T.

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

rock E.T.

Post by Rado1 »

Hi all,

after two+ weeks of trying ZGE and learning various features during nights I created my first simple game, called rock E.T. It's a clone of famous Asteroids from ATARI, but having 3D objects and balanced sounds it is maybe less annoying than original (?).

I realize the game is not perfect and there are several possible ways of improvements; e.g, overall playability, more types of opponents with different behavior, more types of bonuses, better advancement of a player through levels, ... I can implement some more features in future versions, but I'm not sure whether extending such a simple (stupid) game makes any sense at all.

Because of used bitmaps and sounds, it's larger than usual ZGE executable (64kb), but I hope you will excuse me for breaking ZGE's marketing slogan.

Another problem is that I have no clue how rock E.T. behaves on different GPUs an audio devices. I created and tested it on ATI Mobility Radeon X1400 only.

I'm open to any comments, suggestions, ideas, questions...

Have a fun!
Attachments
rockET.zip
rock E.T. exe
(89.52 KiB) Downloaded 927 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Hi Rado1,

Nice complete game,. I likes it! The shot energy creates a cool dynamic that makes aiming and choosing more important than just random blasting, and it is quite hard.
Things I might change perhaps; the collision boxes could be smaller, those bursting badguys could throw less bursty things. Muting could be a 3 level thing all/just sound effect/no sounds. Destroying a ship or burster could randomly drop a mini-battery so we are rewarded, and it helps keep the gun charge up,. . just some quick imprestions.
Overall very nice work, I hope you keep improving on this one (is fun), and do another too. Thanks for posting it.

Oh works great here on a ati 5770.
iterationGAMES.com
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

It looks as if there is a key repeat buffer fill limit, in that if you hold the fire down it machines for a while, then single shots, and will come back some if left alone.

This might be fixable with the key repeat setting, might be a limitation of ZGE, or could be portrayed as a weapon overheated scenario.

EDIT - yur right, Kjell. My excuse ( and I'm sticking to it ) is I'm an old trucker and have tunnel vision.:wink:

------------

Played on a Radeon x1650.

Well done, difficult, and I'm a poor tester because I never did like the genre all that much.

If you would be so kind as to post how you got the music into the game, I would be grateful, as I have never really been able to figure it out from the available documentation ( I just copied a lot of it ), and I would re-write our docs.
Last edited by y offs et on Thu May 06, 2010 5:12 pm, edited 1 time in total.
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi, good work!

Interesting that you allow "reverse thrust", this gives the opportunity to back away from asteroids and enemies while blasting them, fun!

It is quite hard, even if you didn't have the gun overheating mechanic, so I would tune that down. I don't like when I can't shoot as much as I want to :)

Nice sound effects, music, and samples. There is a sampled laughter at game over right? Wasn't sure if I imagined it because I have the window open and there are people outside ;)

ATI-card here, and no glitches. Feels like minor slowdowns sometimes but the FPS-value was stable. Do you update the FPS-text every frame with the current value? To get a stable framerate make sure that you don't use higher resolution textures or mesh tricounts than is necessary for these kind of models that are small on the screen.

Impressive that you have learned so much about ZGE without having to ask questions on the forum. Since documentation is a work in progress, please tell us what your primary source of info was: online docs, help-file, videotutorials, sample projects, this forum?
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,

Nice little debut project! Runs fine on my NVIDIA card. I agree with jph on the "spikey-looking" enemies .. the bullets they spawn when exploding are quite difficult to dodge. And don't worry about the 64kb slogan, just because ZGE is lightweight and has a tiny footprint doesn't mean you're not allowed to make "big" games with it.

@ y_offs_et - Music can be done using the "Music" Component ( midi ) + you must have overlooked the "battery" bar at the top of the screen :wink:

Keep it up ~
Kjell
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Thanks for your prompt and valuable feedback guys. Some comments follow (I'm sorry for large text, but you produced a lot of good comments I wanna react to):

Collision boxes: a source of never ending troubles when wanted to be perfect and precise with irregular and dynamic shapes. If tried to use Rect2D_OBB with CollisionOffset, rotation of model did not update collision bound box properly. I would expect that by rotation of a model also CollisionOffset is rotated, which is not unfortunately the case. Instead of updating it "manually" by each rotation I used Circle2D for all larger objects, which is simpler but not precise of course. Another problem was collision bounds of irregular asteroids. Size is given by original sphere but the shape noise is not taken into account. Therefore, sometimes collision is outside and sometimes inside the actual shape of asteroid. Used collision bounds are always trade-offs.

Difficulty of playing: I was playing asteroids-style games from my childhood - that's why I did not realized difficulty of playing by other people. But I'm sure after 10+ minutes player can get some skills and can have more fun. A small trick: you must be far enough or thrusting back when shooting "bursting badguys" :-) (I call them mines). I thought that's the only difficult thing in the game (instead of a lot of flying objects in levels up to 9), that's why used this density of generated bullets.

Sound on/off: that's good idea that muting will just decrease level of all sounds but music is switched off. Do I understand it correctly jph?

Key repeat buffer fill limit problem: there is no a key repeat buffer fill limit, the behavior is intentional. If you look at top of the screen, there is an energy (gun overheating) bar marked by battery symbol. If you do not have energy, you cannot shoot. To help player, energy is slowly charging automatically by time. A consequence is that if you do not have energy to shoot a single bullet, after some time you can shoot again, but the frequency is smaller that the normal one. One possible change would be that frequency of shooting is proportional to energy; what do you think?

Battery charging: As you surely observed there is a "large" battery flying around from time to time. Its catching charges the whole energy bar. But I like the idea of small batteries appearing at places of destroyed enemies; thanks for idea jph!

Music: As Kjell mentioned I used Music component to load midi file and MusicControl to switch on/off the background music. I had several quite successful experiments with producing realistic sampled instruments if midi contains more than one instrument (tested on Metallica, Dream Theater and Pink Floyd), but the current version of ZGE has some usability restrictions (e.g. do not import also instrument sounds, or editor of sound component is not synchronized with sound's properties and it's settings are not properly saved) and the final exe is much larger, because of imported samples (raw files) for each instrument. Finally, I decided for very simple one-instrument midi and sound created by built-in sound synthesizer. Laugh was imported as a raw file generated in OpenMPT (the laugh sample was taken from some public sound library). I was also trying to use bass library to play MOD files and later also mp3 files, but distributing more than one file is not what I wanted to do with such a simple game. Which editor do you use to produce/transform MOD and raw files? I used OpenMPT, but I'm not experienced in this area. BTW online help mentions Audacity as possible producer converter to raw files. I was never able to produce a correct raw file with Audacity.

Performance: FPS-text is rendered/updated on each application's OnRender pass with the current value. I will check my meshes to find opportunities for reduction of point numbers. One problem I see is explosion of rocket decreasing FPS twice. I used two RenderParticles, both with 100 ParticlesPerSecond. Isn't it too much? Another problem might be rotating of stars. I used dynamic rotation of textures made of 128x128 bitmaps. Should I use some another technique, e.g., sprites or particles instead of bitmaps?

Problems with texture mapping: a general problem I was not able to cope with was to apply textures on spheres seamlessly. After some experiments I finally used Generated TexCoords, because it's simpler, but is not looking nice as you can see it on asteroids. I also tried to compute TexCoords for sphere-based meshes and to apply ModelDefined mapping, but I always had problem with one segment (meridian) of sphere where the mapping was corrupted. I also tried to use GLSL shader to map texture, but with the same problem (even if the shader was correct in ShaderDesigner). The reason is probably incorrect (discontinuous) mesh for sphere. Can someone give me an example of seamless mapping of a texture to sphere?

Sources of learning: included help file (nicely done!), this forum with many submitted examples, video tutorials on YouTube, and Wikipedia for info about sound generators.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,

Are you using the BitmapZoomRotate Component to rotate your textures, or the TextureRotate property of a MaterialTexture Component? I certainly hope it's the latter :wink: Also ( not sure whether you're doing this or not ), never put resources that don't have to be unique for a Clone in a Model's Definitions.

There's no single way of correctly UV Mapping a Sphere. But I've attached a .zgeproj containing two common approaches for non-distorted textures.

And I use Audacity to convert audio samples into RAW format.

K
Attachments
Spheres.zgeproj
(4.24 KiB) Downloaded 816 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

You seem to have found workarounds for many ZGE limitations instead of giving up, good perseverance!

I haven't touched the midi-functionality for a long time so I'm surprised it is still working :)

Audacity does indeed work for generating raw-files, here is a thread where Kjell describes the procedure involved.

The problem with using noisy (organic/digitized) data such as sampled audio or jpeg-photographs is that they do not compress well with lossless compressors such as Upx. To solve this the ZGE-engine itself would need to decompress the data on startup. A mp3 or jpg decompressor algorithm is complex and would increase the exe-size significantly. Using decompressor libraries found in the operating system would limit the cross platform portability. I'm open to suggestions on the best way to solve this.
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Audacity version 1.2.6 supports raw format. The newer beta versions seem to have dropped that for now. Docs updated to show this.
"great expectations"
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Collision boxes: Not sure why you would need the collision offsets? I have not test that function much. On playing it again they are quite good,. I think it was just the green shots that I though, if it where me, I would half the size of, as they are partially transparent and the 'edge' is vague. this would give the palyer a bit of a brake. No biggy.

Sound on/off: my thought was to add a mode with just the music muted. I like to listen to long DJ mixes when I am working on my games, and playing others. so: full sound/FX only/all muted. (or separate mute for music and FX)

Battery: Personaly I think the ballance of shot charge metter is good,. adding the 3rd-5th size small ones will make the game more 'shooty',. Also I noticed that the batteries can be destroyed(!) perhaps when that happens 3-5 little ones are spawned then the player still has a chance to get them only is harder!

MIDI: the ZGE midi engine seems quite good,. I have only used it for small phrases, with single instrements. If the file has more you just need to tweek out some zge synth sounds for them. Mostly I use notes saved in arrays that I can more directly contol the playback of, for more dynamic music, although I have not gotten so far with this,. . (limited time)

MODs are a great alternative if you are using BASS etc. ReNoise is one of the best. [ http://en.wikipedia.org/wiki/Renoise ] I use this; http://www.milkytracker.net/ and also this; http://nitrotracker.tobw.net/ on the DS!

[ Ville; perhaps we can find a library that would make it simple to add sound file conversion into the editor? No change to the engine, just making it more approchable for ppl to add samples? i.e. editor converts them to RAW. ]

Anyway, still loving you game, played some more and indeed am getting better at it!
iterationGAMES.com
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

rotation of model did not update collision bound box properly
As related to - I ran into this problem with Box3d on a rotated wall section. I fixed it by adding this to the onSpawn of the model.

if ( CurrentModel.Rotation.Y != 0 )
{ CurrentModel.CollisionBounds.X = 0.1;
CurrentModel.CollisionBounds.Z = 1
;}

ZGE doesn't show CollisionBounds. (plane) in the code completion ... yet.
"great expectations"
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi all,

Kjell: I'm using TextureRotate property of a MaterialTexture Component; dynamic updating of bitmaps is deadly slow. As an alternative, I also think about rotating whole sprite with texture. This might require stretching the sprite more (with lower density of bitmap), but might bring interesting features if moving also Z position (zoom in-out). Generally I put resources outside models; one exception was mesh and texture bitmap of asteroids, they are unique for each model instance - I hope this is a correct practice. I'm not sure about definitions put to application states, are they instantiated each time the application state is activated? BTW very nice spheres!!! I have no/little practice with computation of 3D objects and I learned some tricks from your code. I'll use it for better texture mapping to asteroids in rockET. Cannot be these spheres put to distribution of ZGE; part of standard mesh library?

Ville & y offs et: I tried Audacity again and the produced raw files work fine with ZGE. I previously told that the files are not correct because they could not be played in Winamp (sometimes Winamp even crashes) - my misunderstanding.

jph: I used collision offset in a version where the rocket was asymmetric - rotation center was not in center of its mesh. In the current version collision offset is not used. Now I understand your comment about collision boxes; it was about green bullets only. I'll rework all bullets to be smaller and more "sharpen". The possibility to switch music on/off independently on FX sounds will also be added. Do you have some trick how to transform MIDI to values in arrays? What's your preference for format of arrays storing music tracks? How to achieve their correct timing? Can you give me some examples? Thanks for MOD software pointers.

Some ideas for ZGE: what about to show collision box in the model preview window? Similar to showing normals. Another small improvement would be to allow disabling of elements, without their removal; e.g. by some flag. When trying several alternatives of "code" removing some components, trying alternative ideas with other components and returning to original code in case of failures, I usually put unused parts to some "garbage" group placed "aside" (e.g. somewhere in the Content section). This "technique" is difficult to use if you have several places where you have code alternatives.

Fine, I'll produce an improved version of rock E.T. when I find some free time in next days.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,

You're using Textures and Definitions correctly yes .. although I suspect that the minor slow-downs people have been experiencing are caused by the fact that you're generating a individual bitmap & mesh for each asteroid. And yea, the MeshSphere component should be replaced with a proper sphere :roll:

On music in ZGE .. you're better off using a DLL for the time being ( if you care about precision ). The Music ( Midi ) component basically triggers notes on a frame-based interval, whereas "normal" applications would write to a sound-buffer. And since there's no way to access or simulate a sound buffer, you'll run into the same problem when using the trigger-notes-from-array method.

Now I hate to say this ( sorry Ville ), but the build-in collision behaviors are full of inconsistencies, which makes being able to debug them a absolute necessity. So .. attached is a solution for this 8) Simply include the ZExternalLibrary & ZLibrary to your project, and call the renderBounds function from the OnRender event of a Model.

+ I wholeheartedly support your enable/disable checkbox request :)

K

Edit - Typo
Attachments
Bounds.zgeproj
(4.56 KiB) Downloaded 734 times
Last edited by Kjell on Thu May 13, 2010 12:53 pm, edited 1 time in total.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Cool Rado1, looking forward to the vatest ver.!
No my array music is not from midi,. put perhaps that is possible,. I just do small note progressions and simple beats. (minimalism works some times) I thought I posted the player setup somewhere but I dont see it. I will find it and post in TipsN'Tricks.

For disableing blocks of code, I just drag them into one of these;

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Condition Comment="NULL" Expression="return 0;">
  <OnTrue>
    <ZExpression Expression="// Drop stuff here to not execute."/>
  </OnTrue>
</Condition>
I had wanted the same thing till this idea accured to me, works well enouph.

Kj- that little library is great! I learn more and more GL from your posts.

Ville -perhaps that could be adapted into the editor, as the "Show Collision Bounds" tick box?
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

The feature to temporary disable components for debugging purposes have been discussed a couple of times before. I added this now in the latest beta.

Click the "DesignDisable"-property on a component to disable it in the designer. In generated exe-files it has no effect.

And that collision bounds renderer looks great! I will see if I can integrate it easily in the designer. Well done Kjell.
Attachments
designdisable.png
designdisable.png (5 KiB) Viewed 22273 times
Post Reply