Hedgewars
GSoC project: Sprite engine overhaul - Weekly A&O report #2
The image to the right shows the old encoding sprites had. TTexture described a sprite/texture as a single, shared entity defined by it's width (s.w) and height (s.h), together with the actual image data of the sprite (the rect portion within the black rect). However due to hardware restrictions the actual texture might need to be of a certain size and thus to be larger.
The new encoding splits TTexture to two independant entities. A sprite now stores information about its size and references to physical image by storing a link to it and a position where the sprite is located.
This encoding allows to pack multiple sprites (red rects) into a shared image (black rect). Doing so may reduce the amount of unused empty space as well as the total count of black rects. Graphics hardware generally benefits from both.
Right now however each sprite (red rect) will be created together with a unique texture (black rect) and stored in the lowever left of it, mimicing exactly the original behaviour. The next step on this frontier obviously will be taking the rectangle packer and allocate multiple sprites within shared textures.
Before doing this step however, I'll continue with removing as much deprecated OpenGL1.x as possible and probably write some GL2 renderer.
GSoC project: Sprite engine overhaul - Weekly A&O report
Weekly A&O report
Hi everyone!
This is the very first of my weekly "Achievements and Objects", which will give you some ideas on what I've done so far and what i've planned for the next week.
Achievements
The first big piece of work that I already finished - actually I have done this during GSoC application period - is the rectangle packer.
The general problem is to fit a set of given small rectangles inside a larger rectangle which shall be as small as possible. The reason for wanting this is that graphics hardware prefers working with a single or few large textures over hundreds of small ones.
Unfortunateley there are no known algorithms that solve this problem perfect within feasable time.
Thats why some algorithm that doesnt necesarrily produce perfect results but at least "quite good" results is required.
In particular I've ported the MAXRECTS packer using the bssf heuristic as described here:
More Rectangle Bin Packing
This page contains quite a lot of in depth information about the general problem and as well visualizes different approaches.
The packers are licensed as public domain and thus the port is safe to be used for hedgewars.
You can take a look at my port here uBinPacker.pas.
As well try the test app test.pas
Last week I pretty much started messing around with the games code base.
Currently in the engine a sprite is represented like this: (ommiting irrelevant members)
TTexture = record
w, h: LongInt;
rx, ry: GLfloat;
vb, tb: array [0..3] of TVertex2f;
end;
w and h represent the physical dimension of the sprite in pixels.
The beginning of the adventure
The goal of the project is to port the game to web browsers so that people can enjoy it without installing and it runs on all platforms with a modern browser. Furthermore, web is the future and there will be more and more games that are web compatible. I'm proud that I can be one of the pioneers to try some new things and know how to get it to work.
Since the technology is not mature enough, there are a lot of problems that I can or cannot foresee. The project is not to "hardcode" the game using javascript but rather find a clever way to convert the game engine automatically, which facilitates update and generally is aimed to develop a workflow or framework to automate the conversion process. Pascal and javascript are two different languages; native and web are two different platforms; these differences in terms of language specification and API compatibilities makes the conversion challenging and is basically the problem my project is going to solve.
My proposal divides the project into three phases:
(1) Port run-time library functions that pascal uses into C, which can be converted into javascript using empscripten.
(2) Port SDL functions into C or javascript if needed.
(3) Port the OpenGL code into Web GL.
Phase 1 and phase 2 are pretty much project independent, i.e. I don't need to depend on others' work much. However, I still need to dig into existing tools like empscripten and pas2c to see how smart they are. Phase 3 depends on the optimized rendering system since WolfgangSt is going to rewrite it to make it ES 2.0 compatible, and without the migration, I cannot do the conversion either. Finally I will integrate all things together. If everything works neatly, then it is time to write a web front-end and invite people to play it!
I feel very lucky since I have an awesome mentor nemo who always gives me great help and inspires me a lot. Here I'd like to give my sincere thanks to him and all mentors in advance. And good luck to all participants!
GSoC Project: A New Adventure
Greetings to all!
My name is Szabolcs Orbán, also known as belphegorr on IRC, I come from Romania (Transylvania more specifically) and I am one of the students who got a chance to work on the game.
I will be working on a new campaign for Hedgewars. At the moment, the only options for a player eager to play against the computer offline are quick game and some (training) missions. What I will try to achieve are introducing support for interrelated missions (campaigns) and creating an introductory campaign that would also teach newcomers how to play.
A result of my work would be that performance/decisions made on a mission will be able to affect the behavior of future levels, thus allowing the creation of somewhat more complex stories, with multiple endings, surprises and nigh infinite drama!
I'd like to thanks the developers for giving me the chance to improve the game and mikade for mentoring my work! I'd also like to apologize in advance to all the mentors I will be bugging as I chew my way through the source code!
GSoC project: Sprite engine overhaul.
Hey everyone,
I'm yet another of the few selected students, who is gonna work on Hedgewars during this summer. As Medo42 I'm located in Germany.
My work will be under the hood of Hedgewars.
I am gonna bring the sprite engine from a rather ancient version to recent OpenGL. I'll as well do several internal changes that will decrease the memory and communication stress between the system and graphics hardware.
For those having some interest of the strategies involved to achieve this, I'll refer to OpenGL ES Programming Guide for iOS
Even tho the topic of the link above is iOS specific you can expect that my work will improve performance on almost any system.
As you might have figured, the main purpose is groundwork for bringing/optimizing Hedgewars to mobile systems that support OpenGL ES2. Hopefully this might as well contribute as a foundation for the javascript (WebGL) port, which itself is covered by another student this year.
You might expect quite some cooperation between these two projects due to the overlap.
GSoC project: Video Output Tool
Hi everyone!
I am another student selected for working on Hedgewars as part of the Google Summer of Code. My name is Stepan and I am known as Stepan777 at IRC. If you look at the map of Russia you can find city called Bryansk located somewhere near to Ukraine and Belarus, this is where I am from.
I will be working on the project called Video Output Tool and, as you may already know, I will be mentored by Hedgewars author unc0rr. Currently, if you want to record video from Hedgewars you have to use some screen grabbing application. This is not very convenient. For this reason I will implement an easy way to convert game demo (or even save) to video file which then can be easily shared with anyone.
Another planned feature is YouTube uploader which will allow you to upload recorded videos to YouTube directly from game in just several clicks.
Thanks to Hedgewars developers for choosing me. I had a chance to work for another organization during GSoC but I also choose Hedgewars :).
Enjoy Hedgewars and good luck to all other students with their projects!
Introduction: Medo42 and Netplay for Android
Hi everyone.
I'm Medo42, one of the students who will be working on Hedgewars as part of the Google Summer of Code. Some people might know me as the main programmer of Gang Garrison 2, a game which re-imagines Team Fortress 2 as a game from the DOS era1. There is also a slim chance that you know me from a place called Germany where I am known as Simeon, a student of computer science just finishing his diploma thesis. It's about quadrocopters.
My task will be to fill in the biggest missing pieces of the Hedgewars Android port: Netplay and scheme editors. This means you will finally be able to make and join online games with players from all other platforms, and to customize the game rules and weapons with all the options you have in the PC version. There will also be some work on the internal plumbing, to make it easier for ports to other platforms to add Netplay as well.
A big thanks to all Hedgewars developers for trusting me with this project, and in particular to Xeli who is taking the time to be my mentor and help me learn the ropes. I'm looking forward to working with you.
1 You can play it over the internet though, so there is no need to dust off your nullmodem cables.
GSoC 2012 students announcement
Hi all,
it's my great pleasure to finally announce the GSoC 2012 participants!
We've had around 70 single proposals and lots of activity in our IRC channel! Our participation in last year GSoC and GCI has granted us five slots!
So without further ado let me introduce the students that will acoompaign us throughout all the summer
- stepan777, mentored by Hedgewars author unc0rr, will create a demo converter tool that will simplify capturing live matches and sharing them with your friends or on Youtube;
- xymeng, mentored by our IRC icon nemo, will restructure most of the sources and prepare a full blown WebGL port to play this game on your browser;
- belphegorr, mentored by our Lua guide mikade, will bring a complete story campaign with training missions to add more flavour to this game and to teach newcomers how to play;
- medo42, mentored by our past GSoC student xeli, will complete the Android port writing the remaining customisations and a working client for online netplay;
- wolfgang, mentored by your source breaker koda, will rewrite the rendering pipeline to GLES2.0 for improved graphics performance on desktop and mobile.
The whole team would like to thank all participants for their time spent with us! It is always hard to select the best proposals from such high quality contributions that were sent in for this year GSoC: we hope that everyone has had a good time during the selection period and that everyone is going to hang around our crazy community!
Now let's send our congratulations to the five selected students and wish them good luck with their work! In the following days blogposts will appear to introduce them to the community and present their work in more detail.
We are in for an exciting summer!
Koda
GSoC 2012 - student application deadline
A quick reminder to any applying student who wishes to participate in Google Summer of Code 2012 with the Hedgewars Project: you can submit your proposal until April 6th, 12:00am pacific time.
We will then take a two week break where we will further discuss and analyse each proposal with all the students. Make sure you use this time to improve your proposal with graphics and to fully join the development community, with your (active) presence in IRC and with patch submissions (optional but highly suggested).
Update: Thanks for all the attending students! We've got 73 applications, 2 more than last year! If you wish to edit your proposal, please contact the assigned mentor for it, only he can grant you editing powers.
The selected proposals will be published on April 23rd!
Good luck to every participant!
GSoC 2012 selection starting now!
Hi everyone,
we've got some great news!
We've been accepted to Google Summer of Code for the second consecutive year! :D
The organisation page is already set up: http://www.google-melange.com/gsoc/org/google/gsoc2012/hedgewars
In that page both mentors and students can apply after creating a Google Account.
Please don't forget to visit our GSoC portal at http://www.hedgewars.org/gsoc.html where you can read more about the general rules and about our proposal ideas.
As always for any question visit our IRC channel (#hedgewars on irc.freenode.net) or leave a comment in this blogpost
Good luck to all participating students (as well as mentors!)
Hedgeroid update!
Hello!
news on the android front!
Yesterday I've released a new Hedgewars version to the Android Market, this version is feature-wise one of the bigger releases check it out here:
https://market.android.com/details?id=org.hedgewars.hedgeroid
Together with Koda, we've improved the touch interface. It should be a lot easier to control your hogs and play some games vs the AI. Further more the schemes now work, which resulted the rope working too now (any shoppa players wanna have a go at it? :)) plus a ton of bugs
This is the touch interface in action, be careful the quality is quite low :)
as shown in the video the android frontend needs quite a lot of work for tablets, if you're interested in giving a helping hand please do contact me! :)
Xeli

