ZFGC

Resources => Coding => Topic started by: AleX_XelA on April 02, 2012, 12:06:27 pm

Title: [C - SDL & FMOD] OoT2D Style Text "Engine"
Post by: AleX_XelA on April 02, 2012, 12:06:27 pm
Hai,

As I am making my way through a C learning tutorial, I have decided to try and make a functional OoT2D Style Text engine. It works rather well, and is really easy to use.
(http://img1.imagilive.com/0412/Screen_Shot_2012-04-02_at_25955_PM.png)

Features

How to use
To trigger the several text dialogs already written in both text files :

Feel free to modify the corresponding text dialogs to test the engine. Just follow these simple rules :

It's easy, just copy the examples provided.

About the code
First of all, variables, functions and macros are all in French, deal with it  :P
I am learning C, thus I need to use a C compatible library. The tutorial I am using to learn C uses SDL and FMOD, making the "engine" fully portable (see below for Mac and Windows binaries).
The code is rather noobish, I do not check at all if the functions work well and if the pointers have been initialized properly... However I am rather satisfied with the text displaying function :
Code: C
  1. ecrire("dialog.navi",lttp,ecran,FRENCH, &finish);
It needs the label of the dialog, the alphabet you are using, the general surface of your game (a.k.a screen surface), language, and the finish boolean which will trigger the closing text box sound.

I am not considering this a real engine for various reasons :
First of all, comments are close to nonexistent in the source code, and I guess you will have trouble properly understanding it.
It is not fully functional, as I cannot have an animation behind the text box, I do not yet know how to handle that. For the time being, every time the text box is loaded (every time you press SPACE), it refills the screen with the green color and draws the text box on top of that.
It wouldn't fit in a real game project, certainly things would be coded in a completely different way (resources loading procedure for instance, that would be something completely different).

However it was fun to code and I thought I would share it with you. Plus, with this you could display the entire OoT text dump if that's any fun to you...

Credits
HelpTheWretched : for the sounds, Legend of Zelda sound effects by HelpTheWretched (http://noproblo.dayjo.org/ZeldaSounds/).
Kousou Games for the font : Kousou Games font rip (http://www.kousougames.com/sprites.php?show=Text%20from%20six%20Zelda%20games).

Downloads (binaries + sources)
OoT2D Style Text Engine - Mac (Intel 10.5 and above, 2.31 MB) (http://www.mediafire.com/?znbty08jx8gf234)
OoT2D Style Text Engine - Windows (1.05 MB) (http://www.mediafire.com/?iohae0ey7xd34uy)

For some odd reasons, the Mac version behaves better than the Windows version. Meaning it really feels like OoT. Sorry for the long post...
Title: Re: [C - SDL & FMOD] OoT2D Style Text "Engine"
Post by: thestig on April 02, 2012, 12:30:30 pm
Needs moar http://zfgc.com/index.php/resources/ :D..

Anyways. I think this is good stuff here. What a great way to learn, C too by writing a text engine based around Zelda.
Quote
For some odd reasons, the Mac version behaves better than the Windows version.
Are you using SDL as the renderer, or are you just using it to create a rendering context and have OpenGL as your back-end? The differences probably lie somewhere there. I'm happy to see that you've decided to make this open source. :) And it's cool that you've managed to support two platforms while LEARNING C!

By the way, fix your links. They're broken. As far as your code goes, I managed to download it and glance over it.. it's pretty cool so far, for a learning exercise. :)
OoT2D Style Engine - Mac (Intel 10.5 and above, 2.31 MB) (http://www.mediafire.com/?znbty08jx8gf234)
OoT2D Style Engine - Windows (1.05 MB) (http://www.mediafire.com/?iohae0ey7xd34uy)

^^ Fixed URLs for great justice! I'll edit your post, and fix them if you don't mind. ;p
Title: Re: [C - SDL & FMOD] OoT2D Style Text "Engine"
Post by: AleX_XelA on April 02, 2012, 02:51:31 pm
Nope I am only using SDL and SDL_image to display the graphics.
Well I like learning but it's more fun coding something you enjoy playing with.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved