Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Nov 2010
Offline Last Active Today, 02:40 AM

#5315790 What programming language should someone pair with LUA?

Posted by on 19 October 2016 - 03:48 AM

If you're not doing console game quality, it opens up the floor a bit more, so alternatives to c++ become viable. I'm working on a game project at the moment which is a mixture of C# and Lua.


To answer your question, the "best language to use" is probably going to be whatever language *you* are most proficient in that has a Lua implementation. 

#5287373 towards a faster A*

Posted by on 17 April 2016 - 07:25 PM

I second Alvaro's suggestion re: the Heap. I remember reading about A* and not know how a heap worked it seemed pretty scary, but once I had a crack at implementing it and it started to made sense, my A* implementation became several orders of magnitude faster. 

#5272099 Unique ID per type

Posted by on 20 January 2016 - 11:40 PM

SeanMiddleditch is 100% correct. If you want to be able to load saved game states (eg: save games), you need to define the Id's in such a way that they can never change. The only way to do this is to assign them yourself.
Generating a hash from the name of the type seems like a good idea, but what if you ever decide to change the name of your class? For example if you decide that "LightComponent" should be "LightingComponent"?


Another thing you will need to consider is hash collisions. They are rare, but they can happen. Check out the hash collision tests done in the following stackexchange post: http://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed
They found 7 collisions in the english dictionary using the DJB2 algorithm you're considering:

DJB2 collisions

  • hetairas collides with mentioner
  • heliotropes collides with neurospora
  • depravement collides with serafins
  • stylist collides with subgenera
  • joyful collides with synaphea
  • redescribed collides with urites
  • dram collides with vivency

#5270601 Drawing on Timer tick

Posted by on 11 January 2016 - 04:31 PM

Have a look at Dispatcher.Invoke(). It's designed precisely for this purpose.



#5240174 [SlimDX] Information on the history of SlimDX

Posted by on 13 July 2015 - 08:24 PM

As a user of SlimDX, I'd like to thank you all for your hard work. 

#5222839 Stream Leaks in SharpDX

Posted by on 12 April 2015 - 07:22 PM

I'm using SlimDX targeting Dx9 (your mileage may vary), and an example of how I use the DataStream object is as follows:


            using (var dataStream = _indexBuffer.Lock(0, sizeInBytes, LockFlags.Discard))

My understanding of DataStreams is that they are temporary objects that are used to get data in and out of the D3D objects. 


So with that in mind, I keep an in-memory copy of the raw data in an array (_indices in the above code), and when that is updated, I call the above code to commit those changes to the actual index buffer.


#5221215 How should systems pick which entities to process? (Entity Component Systems)

Posted by on 03 April 2015 - 05:05 PM

In my ECS, the systems themselves know which components they need to work with. I'm working with C#, so I've implemented that through Attributes. 


When an entity is created, the EntityManager notifies each system that a new entity was created, and the systems decide if they should care about it. If they do, they add the entity to their internal membership list. Similarly, whenever a component is dynamically added or removed from an entity, the same process is performed, and in some cases results in the entity being removed from the membership list of the system.


Finally, I have two different lists to specify the relationship between the component and the system. "AllOf" or "AnyOf". "AllOf" means the entity has to have all of the components in the list to be processed by the system. If any are missing, it is ignored. "AnyOf" means the entity will be included if any of the components are present on the entity.

#5195322 Where It all begins

Posted by on 29 November 2014 - 04:12 AM

I'm a Software Development student at the University Of South Australia *Waves*.



Whoa.. a local on gamedev? *Waves back* 


If you are competent in 3 languages, its time to pick one of those and start a small game project. A lot of people on these forums recommend pong or something similarly simple, and though it sounds patronising, pong introduces you to most of the core concepts you'll encounter in any game. Eg: taking input from the player, drawing to the screen and the all important game loop.


Robert Nystrom's recent book "Game Programming Patterns" has some great stuff in it if you're transitioning from traditional software development to games. There's a free version hosted on his site at: http://gameprogrammingpatterns.com/contents.html but it is also available in various eBook formats as well as print.

#5194388 Funniest line of code ever ?

Posted by on 24 November 2014 - 06:12 AM

This snippet comes courtesy of some healthcare related development I'm involved in: 


if (staff.StaffType != null && !staff.Staff.StaffTypes.Any(st => st.StaffType.Id == staff.StaffType.Id))

staff.Staff.StaffTypes.Add(new StaffStaffType(staff.Staff, staff.StaffType));




Reminded me of the "Spam Spam Spam..." Monty Python skit.

#5194223 Game Maker v1.3 Code Crashes Game

Posted by on 22 November 2014 - 10:46 PM

A program becoming unresponsive is quite different to crashing. What you've described sounds more like an infinite loop. From the code snippet you provided, I can see two while loops that - depending on the return value of place_meeting()  - could loop endlessly. I'd start by looking in there.

#5192930 is there a better way top refer to assets in a game?

Posted by on 14 November 2014 - 07:16 PM

is high on readability, but runs slow.


Do you have evidence to back up that claim? How is passing a string to a sound playing function noticeably slower than passing an integer?


Are you trying to say that loading the sound asset from disk by filename is slow when compared to pulling the sound asset from a cache by its integer id? If so, then yes that would be noticeably slower.


You can get the best of both worlds however by using an associative array (or dictionary) to allow you to look up the assets by some unique string... such as the filename.

#5190029 Game Development with Delphi: "Yes or No?"

Posted by on 29 October 2014 - 03:36 PM

I'm a software developer working in the healthcare industry. I've been using Delphi professionally for 12 years, and C# for about 5. Over the years I've created a few small game projects in Delphi (using OpenGL), and more recently I've embarked on a much bigger game project in C# (using SlimDX).


For me, the writing was on the wall regarding Delphi, so back in 2008/2009 I decided I needed more job skills to stay competitive, and started learning C#. When it came to the decision about which language to build my new game idea in, C# was an easy choice. There's nothing better than a nice meaty project to grow your programming/language skills.


Your original post is a little ambiguous on intent. Ie, are you just trying to ascertain Delphi's popularity as a game development language or are you genuinely trying to come to a decision regarding what to use for your next project?


If its the former, I'd say, "No". I wouldn't recommend Delphi as a platform. There's too few of us that know Delphi compared to something like C#. It's hard enough to get other people to collaborate on game projects, I wouldn't want to reduce the pool further. Similarly, there are less games tutorials or examples of games written in Delphi, which limits the learning resources you can draw on.


On the other hand, if its the second option then I'd figure out how good your Delphi skills are versus other languages, or if you're interested in learning something new.


There's a lot more to games development than just picking the language to use. There's game loops, resource management, rendering, efficient data structures etc.. and all those can be implemented in ANY language.


My advice: pick the language you're most comfortable with, and go nuts.

#5189293 "Click to start the game"

Posted by on 26 October 2014 - 05:30 PM

In most cases I think its a console requirement. In order for a game to be certified for a consoles, the games developers have to abide by the console's conditions, such as the "click to play" screen. Another I've seen is the "this icon means the game is saving, don't turn off the device" notification.

#5187934 Percentage Health (100%) vs. Numbered Health (100/100)? Which ones better?

Posted by on 18 October 2014 - 11:50 PM

You already have a percentage showing - the visual bar is your percentage (if the bar is half light-red and half-darkred, then you know you are roughly 50%). Showing a textual percentage (such as "53%") is somewhat redundant. 


This is the exact conclusion I came to when tackling the same question for my own game. I'd definitely go with something like "234/500" and let the visual bar represent the percentages. 

#5186642 shadow shader

Posted by on 13 October 2014 - 01:54 AM

This technique would only work with solid objects with a convex profile, right? It seems like something as simple as a torus wouldn't shadow correctly.