It is no secret that, due to nature of modern OOP guidelines, Unreal Engine C++ source code is full of “virtual functions”. It is also no secret that, calling a virtual function is inherently slower than calling a non-virtual function… So, what’s the catch?
A non-virtual call is simply a jump (JMP) to a compiled-in pointer. On the other hand, a virtual call requires at least an extra indexed dereference, and sometimes a fixup addition, which is stored in a lookup table known as Virtual Method Table (VMT). This is simply why a virtual call is always slower than a non-virtual call.
To avoid this overhead, compilers usually steer clear of VMT whenever the call can be resolved at compile time. However, due to complex nature of Inheritence based class structures used in modern game engines, using VMT is unavoidable in most cases.
Virtual Method Table (VMT)
An object’s VMT (also known as vtable) contains the addresses of the object’s dynamically bound methods. Method calls are performed by fetching the method’s address from the object’s virtual method table.
C++ compiler creates a separate VMT for each class. When an object is created, a virtual pointer (VPTR) to this table is added as a hidden member of this object. The compiler also generates hidden code in the constructors of each class to initialize new object’s VPTR to the address of its class’ virtual method table.
The virtual method table is same for all objects belonging to the same class, and is therefore typically shared between them. Objects belonging to type-compatible classes in an inheritance hierarchy will have virtual method tables with the same layout.
Tip: The C++ standards do not mandate exactly how dynamic dispatch must be implemented, but compilers generally use minor variations on the same basic model. The VMT is generally a good performance trade-off to achieve dynamic dispatch, but there are alternatives, such as Binary Tree Dispatch (BTD), with higher performance but different costs.
Speaking of hidden codes and VMTs in the constructors of each class, each C++ object should also contain additional information about its type. An object’s data type is a crucial information in terms of casting.
Run-Time Type Information (RTTI)
RTTI is a feature of the C++ programming language that exposes information about an object’s data type at runtime. It can apply to simple data types, such as integers and characters, or to generic types.
Run-Time Type Information is available only for classes that are polymorphic, which means they have at least one virtual method. In practice, this is not a limitation because base classes must have a virtual destructor to allow objects of derived classes to perform proper cleanup if they are deleted from a base pointer.
RTTI is used in three main C++ language elements:
The dynamic_cast operator: Used for conversion of polymorphic types.
The typeidoperator: Used for identifying the exact type of an object.
The type_info class: Used to hold the type information returned by the typeid operator.
In order to perform cast-related operations listed above, RTTI heavily uses VMT. For example, given an object of a polymorphic class, a type_info object can be obtained through the use of the typeid operator. In principle, this is a simple operation which involves finding the VMT, through that finding the most-derived class object of which the object is part, and then extracting a pointer to the type_info object from that object’s virtual function table (or equivalent).
In terms of performance, using the dynamic_cast operator is more expensive than type_info. Given a pointer to an object of a polymorphic class, a cast to a pointer to another base subobject of the same derived class object can be done using a dynamic_cast. In principle, this operation involves finding the VMT, through that finding the most-derived class object of which the object is part, and then using type information associated with that object to determine if the conversion (cast) is allowed, and finally performing any required adjustments of the pointer. In principle, this checking involves the traversal of a data structure describing the base classes of the most derived class. Thus, the run-time cost of a dynamic_cast may depend on the relative positions in the class hierarchy of the two classes involved.
Tip: In the original C++ design, Bjarne Stroustrup did not include RTTI, because he thought this mechanism was often misused.
Hacking VMT and RTTI Information using UE C++
In order to gather “header” information (that contains VMT and RTTI data) in an Unreal Engine C++ class/object, I have written the following LogClassHeader() C++ function using Visual Studio 2019 version 16.3.8 for Unreal Engine version 4.23.1.
void UDebugCore::LogClassHeader(void* const pThis, size_t nSize)
FString fsClassName = "NULL";
FString fsObjectName = "NULL";
UObject* const pCastedToUObject = (UObject*)(pThis);
void** const pCastedToHeader = reinterpret_cast<void**>(pThis);
fsClassName = pCastedToUObject->GetClass()->GetName();
fsObjectName = pCastedToUObject->GetName();
for (size_t i = 0; i < nSize / sizeof(void*); i++)
MACRO_PRINTF("Pointer[%04zu] = 0x%p", i, pCastedToHeader[i])
This function has 2 input parameters:
pThis: Object to extract Class Header Info from nSize:Size of Header
Calling the function is very easy. You simply insert your call into the constructor of the class that you would like to hack. For example, the following code gathers C++ header information of <APlayerControllerThirdPerson> class.
When you run the code, all pointers that are available (and used) in the header of <APlayerControllerThirdPerson> will be listed. And, in case you need, instance name and class type is stored in fsObjectName and fsClassName variables, as a bonus.
So, what do these numbers mean? Well, all these pointers are addresses of the virtual functions, followed by some of the member variables. In order to understand which is which, we need to decipher the structure of the data set.
Here comes the tricky part! With each and every update to Visual Studio C++ compiler, the structure tends to get updated as well. In other words, the header structure of a C++ class changes with each major compiler update. Try to think of it as a “living organism”. As I’m typing this sentence now, a new update with a new C++ header structure may be on its way. So, it is up to you (!) to analyze what’s going on under the hood.
Good news is, we can gather <template> information about C++ class header structure from the official Microsoft patent documents! Although they are not up-to-date, I think it is a good practice to start the investigation using the source of information itself.
Here is some of the Microsoft patents which describe various parts of C++ implementation used in Visual Studio:
US Patent #5410705:“Method for generating an object data structure layout for a class in a compiler for an object-oriented programming language”
US Patent #5617569:“Method and system for implementing pointers to members in a compiler for an object-oriented programming language”
US Patent #5754862:“Method and system for accessing virtual base classes”
US Patent #5297284:“Method and system for implementing virtual functions and virtual base classes and setting a this pointer for an object-oriented programming language”
US Patent #5371891:“Method for object construction in a compiler for an object-oriented programming language”
US Patent #5603030:“Method and system for destruction of objects using multiple destructor functions in an object-oriented computer system”
So, what I’m offering is, good old-fashioned “reverse engineering”.
– “Is such a challenge worth it?”
– “Um, yes!… If it doesn’t break you, it can make you.”
Bjarne Stroustrup, “A History of C++: 1979—1991”, p. 50 – (March 1993)
Keith Cooper & Linda Torczon, “Engineering A Compiler”, Morgan Kaufmann, 2nd Edition – (2011)
Microsoft Visual Studio Documentation, “C++ Run-Time Type Information” – (November 2016)
“Technical Report on C++ Performance”, OpenRCE.org – (September 2006)
“Reversing Microsoft Visual C++: Classes, Methods and RTTI”, OpenRCE.org – (September 2006)
When I appreciate ‘the moment’, happiness follows. Happiness is often in the little things, and year 2018 has offered me a bunch of them. Sincerely thankful and grateful for all the little things I have been given this year… Now is the time to cherish the ‘moments of joy’ by sharing a few snapshots, in no particular order.
Unreal Fest Europe 2018
A three day event designed exclusively for game creators using Unreal Engine, with speakers drawn from Epic, platform owners and some of the leading development studios in Europe took place in Berlin, April 24-27. Such a great opportunity for meeting old friends, and making new ones. – Thank you Epic!
It is no secret that Nintendo is using Unreal Engine 4 for their current and upcoming line of Switch games. As an Unreal Engine developer, I had the privilege of visiting Nintendo European Research & Development (NERD) in Paris for a 1-on-1 meeting. Due to usual Nintendo regulations, I’m not allowed to share any kind of information about the top-notch engineering stuff that I had witnessed, but that can’t prevent me from telling you how much I was impressed. All I can say is “WOW!” 😉
I have great admiration and respect for Japanese business culture, which is genuinely represented in Paris. Thank you very much for your kind hospitality!
IndieCade Europe 2018
IndieCade continues to support the development of independent games by organizing a series of international events to promote the future of indie games. This year, we had the 3rd installment of European organization, and it is getting better and bigger each year. I love the indie spirit. No matter how experienced you are, we always have new things to learn from each other.
From my perspective, the most iconic moment of the event was meeting and chatting with Japanese game developer Hidetaka Suehiro (aka “Swery65”), the designer of The Last Blade (1997) and The Last Blade 2 (1998). Both games were released by SNK for Neo Geo MVS – my all time favourite 2D console.
So, guess what we talked about… Fighting games? No… Neo Geo? No… Game design? No… Believe it or not, our main topic was “best hookah (water pipe) cafés in Istanbul”. I’m simply amazed to discover that he knows Istanbul better than me. Swery65 is full of surprises!
mini-RAAT Meetings @ MakerEvi
Try to imagine an unscheduled last-minute “members only” meeting, hosting crème de la crème IT professionals ranging from ex-Microsoft engineers to gifted video game artists, acclaimed musicians, network specialists, and many other out of this world talents, in addition to a bunch of academicians with hell of titles and degrees! So, what on earth is the common denominator that brings these gentlemen together, at least once or twice a year? Retrocomputing, for sure… Bundled with fun, laughter and joy! 🙂
Special thanks to our host, MakerEvi – a professional ‘Maker Movement Lab’ dedicated to contemporary DIY culture, fueled by the artisan spirit and kind hospitality of The Gürevins. An exceptional blend of local perspective and global presence.
This year, my dear daughter has graduated from Collège Sainte Pulchérie YN2000 with DELF B1 level French diploma, a compulsory certificate to follow studies in the French higher education system. Being a hardworking student, she has passed national high school entrance exam, and is currently attending Lycée Français Saint-Michel. – “I am proud of you… Bonne chance, ma chérie!”
“The bond that links your true family is not one of blood, but of respect and joy in each other’s life.”
– Richard Bach
Family is a ‘sanctuary’ for the individual. If we are blessed enough to have a loving, happy, and peaceful family, we should be grateful every day for it. It is where we learn to feel the value of being part of something greater than ourselves. Love is a powerful thing; we just have to be open to it.
Life is a Celebration
For all the moments I have enjoyed and to all my dear friends & members of my family who made those meaningful moments possible, I would like to propose a toast. Would you like to join me for a glass of absinthe, so that we keep on chasing our ‘green fairies’ together and forever? 😉
On the 30th of October at 08:15, the courtyard of Conservatoire National des Arts et Métiers (CNAM) was softly lit by a heart-warming morning sun, occluded by grey Parisien clouds. Just like a cool Morrissey tune; no rain, no cold, no rush. Pure tranquility… At the womb of Art and Science, I somehow felt at home.
As I was wandering around the registration tent and looking at the statues of worldwide known scientists, I bumped into an elderly British gentleman, who was also wandering around alone. We looked at each other for a moment. With a gentle smile, I said “Good morning Mr. Livingstone. Such a great pleasure meeting you, again, Sir!”. As I reminded him who I was, we instantly started talking about the good-old days at Core Design (Derby), and the heydays of 8/16-bit video game development in UK for sure. – What a privilege! For a moment, I thought time stood still.
As the chit-chat and laughter started to peak, I have noticed that we were surrounded by a bunch of young game developers, carefully listening to Mr. Ian Livingstone… Well, it’s quite normal. One does not simply bump into ‘a living legend’ everyday!
Sir Ian Livingstone –yes, he has been knighted once or twice!– is one of the founding fathers of the UK games industry. He is the co-creator of Dungeons & Dragons RPG franchise, author of Fighting Fantasy RPG books, game designer and board member of Domark, co-founder and chairman of Eidos (the company that acquired Core Design and started the Lara Croft:Tomb Raider franchise), and winner of a BAFTA Special Award! In the Wired 100 list for 2012, he was ranked the 16th most influential person in the UK’s digital economy… Now, you know what I mean by ‘a living legend’.
When he asked what I had been doing nowadays, I replied with a witty smile: “Nothing new. Same video game development thing for the last 32 years, Sir!”. We all laughed. He pointed at me and said “Look, we have a newcomer here!”. We all laughed, again… As he kindly looked into my eyes, I knew he was going to switch to something serious: “You know what, after all those years it’s time to start your own company, Mert!”. I gently bowed, and replied “One day I certainly will. Thank you, Sir! For now, I would like to keep on freelancing as much as I can”. He kindly nodded and smiled, as no one in the video game business knows the meaning of ‘freedom’ better than him. I thanked him again for his kind advice and understanding.
When the conversion was over, I felt like I was blessed by the God of video game business. I was relieved to see everything I have done in 3 decades was approved with a gentle nod. That means a lot to me. Relieved, by all means. – (Now, what would you call that; coincidence or destiny?)
The funny thing is, right after the conversation, I realized how young developers were strangely looking at me while whispering to each other: “Well then, who the hell is this long-haired mortal punk chit-chatting with the almighty Sir Livingstone?!” 🙂
Keynotes and Performances
Featuring two days of talks around creative industries, community support, and tools & technologies, there was something for everyone, from experienced designers and veteran artists to folks just getting started.
For me, the highlights of the meetings were;
“Life is a Game” – Ian Livingstone “How Not To Kill Your Art Director” – Vincent Gault “How Not to Go Bankrupt” – Cliff Harris “The Late Game” – Brie Code
All meetings were held at the authentic Conservatoire National des Arts et Métiers (CNAM) amphitheatres, the largest of which can accomodate an audience of 750. These amphitheatres are still heavily used today, as CNAM offers a doctoral degree-granting higher education establishment and Grande école in engineering, operated by the French government, dedicated to providing education and conducting research for the promotion of science and industry. It is a continuing education school for adults seeking engineering (multidisciplinary scientific program) and business degrees, proposing evening classes in a variety of topics.
Show & Tell Demo Area
It was certainly worth visiting each and every indie game developer at the demo area. Bringing young talents and industry veterans together is a step forward for developing better games. We learn from each other. No matter how experienced you are in the global game development industry, there is (and will always be) more to learn. It is in the nature of video game development business.
On the Way Home…
After 2 days full of playing games, meeting game developers and attending various game related events, it was time to go home – yep, for game development! The thing is, I wasn’t aware of the surprise waiting for me at Paris Charles de Gaulle Airport.
Even more games!!! 🙂
In case you wonder, here is the full list of locations you can play Sony PlayStation 4 games -free of charge- at Paris CDG Airport.
Terminal 1: Satellites 1, 3, 4, 5, 6 and 7
Terminal 2: Gates A39, C85, D40 and D66
Terminal 2E: Hall K Gates K36, K43 and K49
Terminal 2E: Hall L Gates L22, L25 and L45
Terminal 2E: Hall M Gates M25 and M45
Terminal 2F: Gates F22 and F46
Terminal 3: International boarding lounge
Nowadays, I’m reading a tiny HarperCollins book called “Blood, Sweat, and Pixels”, written by Jason Schreier.
It is a journey through ‘development hell’ – a media industry jargon for a project that remains in development (often moving between different crews, scripts, or studios) without progressing to completion. In other words, ‘a never-ending project’.
So, if you have ever wondered what it takes to be a video game developer, don’t read this book! It must be the very last introductory document you should be referring to. – Just kidding! 😉
“If I ascend up into heaven, you are there: if I make my bed in hell, behold, you are there.” – (Psalm 139:8)
Jason Schreier takes readers on a fascinating odyssey behind the scenes of video game development. Ultimately, a tribute to the dedicated diehards and unsung heroes who scale mountains of obstacles in their quests to create the best games imaginable.
Life is hard for video game developers. Very hard, indeed… Thanks to nice small touches and heavenly surprises, life is more bearable. This book is certainly one of them. Thank you Jason!
During our recent summer holiday in Paris, my beloved wife and daughter decided to take a day off and go out for shopping without me. – What a gift! I felt very privileged to have been given back the opportunity of being a ‘freeman’, despite the fact that it was only for a few hours 😉
Against ticking clock, I decided to feed the never ever growing up child within me, and dedicate the whole day to visiting all official LEGO shops in Paris. – Sounds crazy? Well, if you are a LEGO addict like me, then you know what I mean…
When I googled for LEGO shops, I’ve realized that most of the information available online is either misleading or outdated. After a couple of trial and errors, plus many hours wasted on road, I have managed to visit all 3 official LEGO stores in Paris.
The LEGO Store – Les Halles
The LEGO Store – So Ouest
The LEGO Store – Disneyland
During the metro trip back to hotel, I promised myself to write a clear blog post about all the information that I had gathered, so that it could be useful to other LEGO fans visiting Paris.
So, here we go!
The LEGO Store – Les Halles
This is a brand new 400 m² LEGO store established in April 2016. It is located at the center of Forum des Halles shopping mall.
Directions: Take Metro Line 4 (light purple), and stop at ‘Les Halles’ station. There are more than one exits at this station. No worries! Use whichever you like. Using the stairs and escalators, you will either find yourself in a huge underground shopping mall, or in the middle of a crowded street. In both cases, you are at the heart of the Forum des Halles shopping mall. The LEGO store is at street level (Level 0), on the left-hand side of the main entrance. It is the largest shop on this level. – (Link:Google Maps)
Les Halles LEGO store has a breathtaking showcase. On the left, the store welcomes you with a huge French kitchen set built in LEGO bricks. While looking at the cook, oven, pots, colourful cupcakes, and many other well-thought-out details, it is quite easy to be bewildered while dreaming in front of the showcase. When you walk to the right hand side, you’ll notice two more mega LEGO constructions; The Notre-Dame Cathedral and The Arc de Triomphe. Though both sets demonstrate top-notch brick architecture wizardry, the cathedral construction is a truly remarkable piece of art. The amount of detail –and even humour– that goes into making this set is unreal; tiny goblins and knights walking at the roof speak for themselves 😉
When you go into the store, the first thing you’ll notice is the wall-to-wall layout of shelves. They are clearly categorized with hundreds of boxed LEGO products on them. When you are at the entrance (facing the point of sales), the Duplo products (for babies) are on the left, and the Technic series (for teenagers and adults) are on the right, which is a panoramic categorization from left to right based on age. Simple and effective.
One thing that I really loved is the location of the point of sale. An ellipse shaped desk (with many cash registers on it) is right in the middle of the store! No matter how crowded the shop is, you can always find a shortcut to reach the cashiers.
* This was a real lifesaver during my second visit to this store. I brought my wife and daughter with me on a Saturday afternoon, and the store was so crowded that we couldn’t walk without bumping each other. That day, I really appreciated the wise decision of locating the point of sales in the hotspot of the store.
Last but not least, here comes the jewel in the crown: The staff members. They are simply amazing! Unlike typical salespeople, they are 100% enthusiastic about what they are selling, and specialized in various product categories. These young ladies/gentlemen are always smiling, willing to assist, and very polite.
* And, did I mention that all the French staff members are fluent in English? – Oh, yes!
I have to mention one staff member in particular; Mademoiselle Samantha. For almost half an hour, she patiently answered all my technical questions, visited the storage room (behind the store) a few times, checked the availability of hard-to-find items on my shopping list, made a phone call to one of the other official LEGO stores (So Ouest), reserved the missing items for me, and finally wrote down the directions to make sure that I’ll find my way to that shop safe and secure… Thank you very much, indeed!
The LEGO Store – So Ouest
This is a 300 m² LEGO store established in October 2012. It is located at So Ouest shopping mall in Levallois-Perret, a commune in the northwestern suburbs of Paris. Unlike the previous LEGO store, this one is not at the center of Paris. However, if you follow my directions below, it will take approximately half an hour to get there. It’s not really far away…
So, is this store really worth visiting? Absolutely! This is a fantastic LEGO store in every way. Make sure that it is on your list.
Directions: Take Metro Line 14 (dark purple), and stop at ‘Saint Lazare’ station. Following ‘Île-de-France’ (Parisian region) directions and ‘SNCF Transilien’ (suburban train) icons on the signs, walk to the ‘Gare Saint Lazare’ railway station. Don’t worry, it will take 3-4 minutes to get there. Once you are at the main railway station, go up to the 2nd floor and find the ‘Île-de-France’ ticket office. Buy a ticket for line L. (Since this is a suburban line, there will be no seat numbers on your ticket). Go to the main hall, and check for the next train from the split-flap departure display. Your destination is ‘Clichy-Levallois’ – (line L, remember?). After leaving ‘Gare Saint Lazare’, it is the 2nd station on this line. It will take approximately 10 minutes to get there. When you stop at the ‘Gare de Clichy-Levallois’ station, follow the ‘Centrum’ signs. You will find yourself at the entrance of the train station. Now, your destination is So Ouest shopping mall! In order to get there, follow the ‘Rue Jean-Jaurès’ way for a minute, turn left to ‘Rue Victor Hugo’, walk for 3 minutes, and finally turn right to ‘Rue d’Alsace’. You’ll notice a huge shopping mall at the right-hand side of the street. That is So Ouest. Go in there, take the escalator down to B1, and Voilà! – (Link:Google Maps)
Compared to previous one, So Ouest LEGO store has a less-than-moderate showcase. No mega constructions to speak of, actually. However, the warm demonstration of recently introduced LEGO sets at the showcase instantly grabs your attention, and humbly welcomes you inside… A classy way of making you feel “Let’s see what they have here!” 😉
Contrary to the humble first impression of the store, the product range is simply premium. Don’t let the size and modest atmosphere of the shop fool you; they have everything here for you. All products are sorted by themes. Even on your first visit to this store, it is very easy to find what you are looking for. Everything is self-explanatory.
The staff members are superb! They are very polite, always ready to assist you, and willing to speak about the products that you are interested in. Somehow, you feel that you are being taken care of, and it makes you feel comfortable. From a customer point of view, this is something truly beyond the dated customer relationship lessons taught in business schools. It’s really nice to know that someone is keeping an eye on you.
Speaking of the staff members, please allow me to share my amazing experience with you… As I was gazing at the recently released Porsche 911 GT3 RS Technic set, I humbly came closer to one of the staff members, picked up a list from my pocket, and asked him if any of the hard-to-find items on my list was available, by any chance. The gentleman cheerfully looked at me, and said: “Oh, you must be the guy from Turkey! We were expecting you… Mademoiselle Samantha (from Les Halles store) phoned an hour ago, and told me about the items you are looking for. Your orders are ready, Sir!”
After the initial shock, I stuttered: “Well… Thank you!”
Thanks to Monsieur Damien, every item on my list was already collected from the inventory room, and packed. Besides being a very professional staff member, he was also a nice gentleman to talk with. His English was better than mine. For almost half an hour, we geeked out over the discontinued products, second hand LEGO market in France, and latest additions to my daughter’s LEGO train set collection. – A truly exceptional experience. Merci!
The LEGO Store – Disneyland
This is a huge LEGO store established in 2014. The name speaks for itself, the store is in the heart of Disneyland, Paris. Believe it or not, this is the most crowded LEGO shop I’ve ever visited in my life. Thanks to Disneyland’s reputation, this must be one of the most popular LEGO shops in Europe.
Directions: Take RER Line A (red), and stop at the last station, ‘Marne-la-Vallée’. This station is also known as ‘Parcs Disneyland’. (Both names are used on signs, in addition to a cute Mickey Mouse symbol.) When you leave the train, use the escalators, and go upstairs. If you have your train ticket with you, pass through the turnstiles. (If you don’t have any tickets, you are stuck! No ticket offices available around. You must find the ticket collector, and ask for help.) Leave the station, go out, and make a U-turn to left. Your destination is ‘The Village’ -aka ‘Disney Village’- a small virtual town where you can shop & dine. You don’t need a Disneyland ticket to get there. It’s free, and the LEGO Store is ahead of you. – (Link:Google Maps)
When you look from the outside, this store looks like an ordinary LEGO shop. The showcase is quite good, with a huge LEGO logo and a few 2.5D canvas paintings built in bricks. At first sight, it looks like there is nothing special in here…
However, when go in there, you realize how big the store is and immediately forget about the lacking showcase. The mega LEGO structures simply knock your socks off. They are everywhere! Pete’s Dragon hanging from the ceiling, an authentic life-size reproduction of R2-D2, a magnificent The Sorcerer’s Apprentice visual composition from “Fantasia” with Mickey wearing the blue wizard hat… These are spectacular items. Frankly, even better than the ones at ‘Les Halles’ store!
The product range is superb, just like the other stores I have mentioned. However, stock availability is a serious problem here. I was unable to find quite a number of products which were available in the other LEGO stores, such as pencil box, eraser, pen set, a bunch of recently released Technic sets, and almost all Power Functions products! When I asked the reason for missing items, staff members complained about ‘customer circulation vs lack of space’. I am not quite sure if this is an acceptable excuse.
Speaking of the staff members at LEGO Disneyland store, I have to say that they are simply the weakest link here. They are not smiling, not enjoying what they do, and keep themselves away from the customers. Somehow, they chat with each other by the exit. Nobody cares about you. Yep, I know that it is very difficult to manage such a huge store with such a large number of customers in it, but what I’m complaining about is more than that. When you ask a few questions, all you get is nothing more than “Yes”, “No”, or “I don’t know”. Being aware of the fact that Disneyland is a place most people visit once (and never come back again at least for a few years), I don’t think that you are welcomed as ‘loyal customers’ here. If these staff members think that people come and go, and more will come tomorrow no matter how they treat customers, I’m afraid that is a serious threat to LEGO’s reputation. As a lifetime loyal LEGO fan, I’m truly disappointed.
I love Paris! This was my second visit to the romantic city, and I’m planning to do it again and again, more frequently. For my next visit, I have 2 official LEGO stores on my list that I would love to revisit; ‘Les Halles’ and ‘So Ouest’. Great shopping experience in both cases. Strongly recommended.
December 1, 2013 marks the beginning of my new video game project. The math is simple; I have been working on it for 2 years, precisely. Designing, developing and co-producing… A lot of work has been done, and many more still in progress. All tough tasks. Mostly game design related, such as 3-bit node graph architecture. Plus, a lot of coding…
It has been a busy year, indeed. – So, what’s new?
The most distinguishing element of this project –optimized game development workflow– has been upgraded to version 3. This is something that I’m really proud of. Simply because, it is;
more cost- and time-efficient,
more artwork/cinematography oriented,
100% compatible with bothold & next-gen workflows.
This year, I mostly concentrated on the last item. As we all know, global video game industry is having a hard time trying to make a quantum leap to next-gen video games, as well as keeping the cash flow pumping. Let’s face it, upgrading a business model while doing business is risky! You need to educate developers, reorganize teamwork and improve asset management, while keeping an eye on the ongoing projects and meeting the deadlines. A kind of “make something new, and keep the business running old-fashioned way” situation.
“…using both current and upcoming tools/assets.”
This is exactly where my upgraded workflow comes handy. In simple terms, it is a next-gen game development workflow offering an optimized way of making games for less money/time, using both current and upcoming tools/assets. Because it is backwards compatible, a veteran game development team/company can still use their old-fashioned workflow and make a smooth transition to next-gen video game development process using this workflow.
So far so good, but…
Why on earth is that backward compatibility thing so important? Simply because, when we say “workflow assets”, we are actually speaking about human beings! People with families, children, and responsibilities.
During the last 30 years, I have witnessed the highs and lows of the game development industry. It has always been very harsh on developers on critical occasions. When a “next-big thing” is in, managers start headhunting for next-gen guys. Current developers instantly turn into “old-fashioned guys”, and most of the time get fired. The turnover is so high that most experienced video game developers hate working inhouse for AAA companies. Instead, they prefer freelance business, just like me.
Frankly speaking, I upgraded my workflow to version 3 for a better human resource management. The first 2 versions favoured the management and income aspects of business. Now, the final version concentrates on developers. – Yep, something for my teammates!
We don’t work in a vacuum
Our environment feeds into the work we produce, particularly when that work is creative. Every piece of “thing” in our working environment affects us. What we see, listen, touch, and even smell, stimulates our creativity and in a way gets injected to our piece of work.
So, I made a radical decision. In order to increase my productivity, I decided to split my home office activities into two. Thanks to a painstaking and backaching performance, I moved all my coding/artwork related books, tools and computers from my mom’s house to home. Using some modular equipment from Ikea, I built a custom table wide enough for my desktop monitor and Wacom tablet, and spent a lot of time for cabling and ergonomics. Keeping things tidy, certainly served well. As I promised my beloved wife that I will use less than 2 m² of our living room, I have finally managed to create a wide open space using only 1.98 m². – Oh, that is optimization 😉
Within just a few days, I have realized a positive impact in my productivity. Now, my process is crystal clear. I do all my coding/artwork at home, and music related stuff in mom’s house. And the bonus is, I spend less time in traffic and more with my family.
“Creativity is a gift. It doesn’t come through if the air is cluttered.” – (John Lennon)
Actually, I have so many things to tell you. I really would like to tell more and give you under the hood –technical- details of my upcoming project… I am afraid, I can’t. Until the official announcement, there are things not meant to be known or seen by public. Well, you know, this is how video game business works!
So, I’ll keep you posted whenever I can…
Regarding the latest annual update and current status of my new video game project, I’m planning to open a bottle of wine and enjoy rest of the evening with my family. I think I deserved it.
Speaking of my latest video game development project, yet an another milestone achieved. – Quite a tough one, indeed!
But first, please allow me to focus on some of the very basic mathematical logic definitions heavily used in software engineering, so that we can clearly understand what’s going on under the hood of a decent game development process.
Don’t worry, it’s not rocket science 😉
All video games have gameplay mechanics based on logic. A game is “a set of story driven goals to achieve” from a programmer’s perspective.
When you open a chest, solve a puzzle or kill an enemy, you are actually triggering a logic unit that is predefined within the game code. Depending on game’s technical requirements and gameplay complexity, there can be thousands of these units forming a web of logic units.
Game programmers tend to use graph theory for defining and coding logic units. Each unit is symbolized with a simple geometric shape. A box, a circle, anything… And these units are connected to each other with links.
“Logic units” (nodes) represent tasks that the player will perform.
“Links” (lines) represent the relationship between the logic units.
A node graph architecture is almost identical to an electronic circuit. When you start executing a node graph code, you are actually branching from one component (node, in our case) to an another by the rules you’ve set for the logic units, just like electric current flowing from a resistor to a capacitor. And, as you can guess, this type of signal flow is 100% linear.
When the player accomplishes a task, the node related to that event will be “expired”. In other words, it will be dead. Expired nodes cannot be resurrected. Once they’re done, they will be ignored (skipped) during code execution, forever. – Which is unlikely in electronics! An electronic component, such as a resistor, a diode, etc. cannot be conditionally turned on/off.
Back to 2002 for a “classic” implementation: Flagger
During the “Culpa Innata” development sessions, we precisely knew that we needed a node graph architecture for handling game’s complex execution flow. Many discussions were held on the method of implementation. All members of the core management & development team were expert electric/electronics engineers with no experience in video game production [Reference], but me! As a video game programmer, my perspective towards node graph theory was naturally very different, contrary to their classical approaches. I wasn’t thinking in terms of voltage, current, etc., but focused on just one thing: optimized code execution.
Thanks to my Zilog Z80 and Motorola 68000 assembly language programming background, I offered the term “Flag” for the base logic unit (node), and teamed up with Mr. Mete Balcı for 3 weeks. In December 2002, we developed a tool called “Flagger”.
Pros and Cons
Flagger was a C++ code generator with a very handy visual interface similar to UE4’s current Blueprint approach. Using Flagger, we were able to add nodes, connect them to each other, program the logic behind the nodes/links, and even take printout of the whole node graph scenario. When the visual logic design process was over, it was just a matter of selecting “Generate C++ code” from the menu, and source code was generated within minutes.
Over the following years, Flagger evolved into a more sophisticated development tool capable of handling various scenarios. Although it was a very handy tool and saved many hours during “Culpa Innata” sessions, there were a few problems with the classical node graph theory that the implementation was based on;
Flags were single threaded. Only one node was allowed to execute at a time. No multi-threading.
Flags were expirable. When a task was done, related flag (node) was marked as “expired”, not deleted for the sake of logic integrity.
Flags were not reusable. Once they were expired, there was no way of resurrecting them. – Inefficient memory usage, thanks to hundreds of expired nodes.
Flags were heavily loaded with variables. Too many dialogue related “customized” variables were defined for special cases (exceptions). – Inefficient memory usage, once again.
Flag execution flow wasn’t well optimized because of node-tree search algorithm. The more nodes we had, the longer it took to accomplish the search.
Flag execution was linear. When a node was expired, the graph code was first searching for related nodes and then retriggering the whole diagram from the beginning, like an electronic circuit simulator. – Well, that was ideal for modeling a circuit, not for developing a video game!
A Modern Approach: 3-bit Worker!
13 years later, I have once again found an opportunity to dive into node graph theory, and just completed implementing a new architecture for my latest video game development project. Unlike Flagger, it is something extraordinary! It is very… atypical, unconventional, unorthodox… Well, whatever… You got it 😉
First of all, it has nothing to do with classical electric/electronic circuit theory. This time, I’m on my own, and approaching the problem as a software engineer. Everything I designed/coded is based on game requirement specifications. In other words, it is implemented with “practical usage” in mind.
I have defined the basic logic unit (node), as a “worker”. – (Due to functional similarities, I simply borrowed this term from Web Workers.)
A worker is a background task with adjustable priority settings. It performs/responds like a hardware interrupt.
Each worker is multi-threaded.
Depending on conditional requirements, a worker can expire and/or live forever. If expired, it can be resurrected and/or reinitialized, while preserving its previous state. So, a worker is a 100% reusable node.
Each worker uses only 3-bits! No additional variables, no references, nothing else. – (If necessary, a worker offers flexible architecture for additional variables. However, I find it totally unnecessary. 3-bits are more than enough!)
Inherited workers don’t need additional logic variables. All child workers share the same 3-bit information that they inherited from their parents!
Each worker has a time dependent linear workflow. Just like a reel-to-reel tape recorder, it can be played, paused, slowed down, accelerated, fast forwarded, rewinded, and stopped.
Workers can be non-linearly linked to other Workers! Which means, node-tree search algorithms are no more necessary. There is no “main loop” for executing nodes! Code execution is pre-cached for optimum performance.
Workers are optimized for event driven methodology. No matter how many concurrent active workers (threads) you have in the scene, there is practically no CPU overhead. Ideal for mobile scenarios.
Workers are managed by “Managers”. A Manager is inherited from base Worker node. So, any worker can be assigned as a Manager.
Workers can communicate with each other and access shared variables via Managers.
Whole architecture is 100% platform independent. For a showcase, I’ve implemented it for Unreal Engine 4 using C++ and Blueprints. It can easily be ported to other game engines; such as Unity, CryEngine, etc.
And, most important of all, everything is meticulously tested. – It’s working as of today 🙂
Sure… Due to complexity of comprehending “a set of non-linearly linked time dependent linear nodes”, debugging can be a nightmare. As always, designing simplified and organized logic sets reduces potential problems. – I keep my logic sets neat and tidy 😉
So, what’s next?
Well, to be honest, since all theoretical stuff is done, I’ll switch to game content development. I am quite sure that I’ll keep on adding/removing things to my 3-bit node graph architecture. I will keep on improving it while preserving its simplicity, for sure.
The new video game project that I started working on a year ago, precisely, is going great! With respect to maintaining confidentiality, I still can’t share specific details with you, but I am more than happy to say that everything is going on “as planned”. – Something quite contrary to the nature of game development in general 😉
One for all, all for one
As the co-producer of the project, I have many responsibilities in addition to the usual things that I have to do. Game design, story development, programming, conceptual artwork design, 3d modeling, texturing, music production, etc. Although sounds like a one-man-army project, actually it is not.
“Only one artist takes all the responsibility…”
In order to preserve game’s artistic style, it is quite normal that only one artist takes all the responsibility of designing & planning everything, and making sure that things will be kept/done in that way. And, this is exactly what I am doing nowadays. – (At one point, we will have developers and artists contributing to the project, naturally. Until that moment, everything must be “well-defined”.)
Instead of creating detailed game design documents, some game development projects begin with “conceptual coding”. Same goes for this project. Contrary to traditional game development workflow that begins with documenting the game design, I decided to start with implementing a proof of concept.
Similar to LEGO building bricks, I have been coding fundamental elements of “gameplay”. As a result of these coding sessions, I have clearly envisioned a number of next-gen features that can possibly enrich our game.
We are currently evaluating the options. When the gameplay implementation is over, I’ll go back to game design document for sure. – (Yes, I know that it sounds a bit unorthodox, but I have my reasons. Sometimes it’s good to break old habits for the sake of creativity. In this game, I will let “gameplay” define and drive the game design!)
Spinners and Probability
Coding is all about making decisions. Getting your hands dirty in Mathematics has always been rewarding. Going back and forth between Calculus and Geometry is more than a stellar experience. Not because it makes you a better programmer, but simply because it turns you into a “wise decision maker”.
In terms of design and implementation, this game development project is full of complex decisions. Thankfully, “coding” is the glue between questions and answers. When used wisely, coding offers new ways of dealing with decisions that you derive from Mathematics, and this is exactly what I’m trying to achieve throughout this project.
Content is King!
I spent a lot of time creating a narrative hook, which I believe is the most underestimated element in today’s game design trends! With references from 16-bit retro gaming era, I am quite sure that a well-defined hook creates a huge impact on gameplay.
“Admittedly, I had to make 7 revisions for a ‘great’ hook…”
It was a tough job. In order to fine-tune the hook, I had to rewrite it again and again for many times. After each rewrite, I left it on my bookshelf at least for a few weeks, so that I can completely concentrate on other things as well. When I picked it up weeks later, I was objective enough to assess the tension and come up with fresh ideas. Each iteration added more flavour to the previous version. Admittedly, I had to make 7 revisions for a great hook, which later turned out to be “Level One”. – Worth every minute spent!
Hidden Treasure: “Workflow 2.0”
The most distinguishing element of this project is the optimized workflow that I have been working on as a side project for many years. Thanks to this workflow, our project will have the luxury of really dramatic cost savings, a more “talent oriented” development process, and the competence of keeping game design/style integrity throughout the development process.
So far, so good…
Still thousands of things to do, so I’m going back to work now.
I’ll keep you posted.
The Blog of Mert Börü: Selected Works, Ongoing Projects, and Memories