Tutorial 2: The "Hello World" application

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Tutorial 2: The "Hello World" application

Post by VilleK »

The second tutorial is online now:

Tutorial 2: The "Hello World" application.

Please check it out, and help report any errors or omissions in the tutorial.

I plan to write some more advanced tutorials next week.
abccad
Posts: 4
Joined: Wed Feb 07, 2007 9:28 pm

Post by abccad »

The tutorials are very helpful.

Thanks.

:D
jbomhoff@anteon.com
Posts: 2
Joined: Sat Feb 10, 2007 10:03 pm
Location: Orlando

WAVs and BMPs

Post by jbomhoff@anteon.com »

THe tutorials are great, however, Hellow World crashed for me after I tried adding the sound. I tried a number of changes to the script, but, couldn't get it to play. Also, is there a way to import WAV, MP3, BMP, JPG files?
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi!

Please answer these questions for me to find out what is wrong:

1. Do you get sound when trying the sample projects, like ZPong?

2. Did you try downloading the finished HelloWorld-file at the end of the tutorial? I know that version works for me.

3. Do you get an error message?

And to answer your question: No, there is currently no way to import pre-made content files such as wav or mp3. The reason for that is that ZGE is focused on making tiny 64kb games. In order to to keep files that small, procedural techniques to create content is prioritized. Future versions of ZGE may have a feature for importing bitmaps, though.
jbomhoff@anteon.com
Posts: 2
Joined: Sat Feb 10, 2007 10:03 pm
Location: Orlando

Audio is fine.

Post by jbomhoff@anteon.com »

I figured out the sound problem. My speaker decided to quit just as I was working through the turorial. I'm starting to understand the game engine. Thanks!
John
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

That's great, John :)
I'm working on a new tutorial that will probably be ready this weekend.
nmarshall
Posts: 14
Joined: Wed Mar 14, 2007 11:59 pm
Location: Los Angeles, California

Post by nmarshall »

The Hello World tutorial gives a good introduction to putting together a program.

I think it would be good to explain the screen coordinate system when you start animating the text. My understanding is that the center is 0,0 the bottom left is -1,-1 and the top right is 1,1. This makes a non-square coordinate system since the screen is wider than it is tall. Is that the reason the text always looks stretched out and overlaps horizontally?

After adding the sound I noticed that the sound in the preview was different than the sound in a stand-alone exe. It seemed like in the preview the mixer is active and there was delay applied to the sound. I think this was because I had just been looking at one of the other demos that used delay in the mixer.

In your synthesizer the filter cutoff ranges from 0 to 1 but you don't say what type of response curve it has. Humans hear frequencies with a log curve so we identify octaves easily. It sounds like your range of 0 to 1 is a linear frequency sweep, so I hear most of the movement in the lower numbers. To convert from a linear curve to an exponential curve I used the formula y=(exp(x)-1) / (e-1) giving me the expression:
MySound.FilterCutoff = (exp(0.5 + App.MousePosition.X*0.48)-1)/(e-1);
and I defined the constant e=2.72.

If possible you may want to make the cutoff frequency response exponential within the synthesizer.
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Ah, more good suggestions :)

I updated the tutorial and component reference with a bit of information of the coordinate system used for rendering text.

The current font-handling is not very good, the text looks unprofessional for various reasons. I am planning to add a feature for importing bitmapped font-files so that you can use your own fonts.

When you make changes in the audio mixer screen, you need to add a AudioMixer-component to your project to save the settings. Otherwise the default settings will be used in the exe-file. There is a label informing about this but it is not that obvious.

The software synthesizer is my very first attempt at audio programming. Therefore it is very primitive and comparable to the simplest of analog synthesizers of the 1970's. Most of the parameters are linear, when they really should be exponential as you correctly point out. My requirements for the synthesizer was simply that it should be able to play sound effects for arcade games, like lazer fire and explosions.

There are probably more bugs in the synthesizer, so I will need to upgrade it later on. You seem to have knowledge on the subject (most likely much more than me) so I appreciate your feedback and make notes for future changes.
Post Reply