February 15, 2013
Starting up by downgrading my workplace? Part 1
It’s usually not that much in the focus of the readers of the blog and while I did drop it occasionally, my real life avatar is located at the wonderful city of Zürich, Switzerland. A place thats quality of live was repeatadly prized as the city providing the most quality of life (now it has lost the first place to Vienna.), and its not hard to see why:
That is a photo I shot at a break after lunch. Switzerland is not only beautiful, it has also some of the biggest salaries worldwide, which includes “lower” Jobs like a Mc Donalds employee who goes home after hours of burger flipping each valued with at least 20 Swiss franks (CHF), and a CHF is roughly about an US dollar. Rents (Swiss people prefer to live in rented flats) and grocery are pretty expensive, especially meat. So its a bit evened out. But everything else costs about as much as anywhere else, so each frank you earn over your basic needs will get you better clothes, cars and other things not beginning with the letter ‘c’.
No wonder car connoisseur is a common hobby. I live in an area, where there live 51% foreign people and which has pretty much an image as one for the poor, yet there is a garage only a few minutes from my flat that has a Porsche 959 and various other Porsche preziosa as well as a BMW M1 (no that is not the sport version of the current 1xx coupe).In a pretty easy to break in tin-built building. So you can guess the crime rate is also very low. An official Ferrari Dealership is in the next quarter (they are called cities, but in every other country they would be called quarters of Zuerich). I myself had an, actually cheap and old, Porsche as daily driver and later on got a classic Ferrari as a nice addition to it (which was, by the way, in the end the cheapest car I ever had), which is actually pretty stupid, as public transportation is excellent and often much faster, and you don’t have to worry about parking space that is sparse, even in rural areas.
Photo by Julian Köppe. Exotics aren’t that exotic if you see them every day. In Zürich that includes Aston Martins, which is a miracle to me, because there aren’t produced that many. Half of Aston Martins production seems to be sold to Zürichs citizens.
February 8, 2013
#DemoFriday A first view on Playmory
as it was requested on Twitter, I hereby publish a very early demo (only for two players) of playmory. Click for the Executable.
I really hope someone enjoys it, because I didn’t know that copying the project doesn’t create a fork and saves changes back to the original folder. So I lost todays work while creating it.
February 7, 2013
Gamemaker (GML) Asynchronus Eventhandling
While I was working on my february entry for #OneGameAMonth I ran into a problem. You see, Gamemaker is really good to develop games that follow a certain shape. But as soon as a game gets away from this scheme a bit and needs more individual coding, it’s not really that good. While objects play a vital part, in GML (The [G]ame[m]aker [l]anguage) their usage is somewhat limited. And what became especially problematic was the lack of Events.
See, events are a wonderful thing. Other objects register for the happening and one objects then, e.g. after a certain activity is finished, notifies the other objects. Not really knowing anything about them.
Gamemaker only provides a very limited kind inside the object, where they are essential on how gamemaker works. So its a bit confusing that they missed out on a more global scale. So without that, I had to trick around with global variables and status checks in the step events (which means code that is run through at the rate of the FPS) a ka very expensive one. And the more you do it, the more confusing it gets. It still was working fine when I finished multiplayer, but when I finished the first try on the singleplayermode the cardhouse crashed.
And instead of spending days on debugging, I instead decided to delete this kind of code completely (which meant I had a whole workday to get a working multiplayerversion again, too) and built my own eventmanagement system. And somewhat gnawing with a naming convention that is near on Gamemakers native functions to make it easy for other users to use it.
I have made a Zipfile with 3 Objects and 4 functions that you can import to your Gamemaker project (you can, but don’t have to, place them in an own group) and it will provide you with the following three functions:
event_add(id, name, userEvent);
id = object that throws the event
name = the Name of the event (e.g. “animation_over”)
userEvent: The number of the user event to trigger if the event is fired
event_fire(name);
or
event_fire(id, name);
id = object that throws the event (default is the calling object)
the Name of the event (e.g. “animation_over”)
event_delete(name);
or
event_delete(id, name);
id = object that the event should be deleted for (default is the calling object)
name = the Name of the event (e.g. “event_animation_over”)
! always use this in the destroy event of your object to avoid memory leaks !
Once again the download link: EventHandlingGMX.zip
And please ignore the advertisement below, that’s not the download!