Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Jul 2004
Offline Last Active Yesterday, 11:23 AM

#5287068 How beneficial can personal projects be?

Posted by smr on 15 April 2016 - 12:08 PM

I can say from my own experience that without personal project, I'd likely be flipping burgers today. Instead, I lead development of software that is used to plan all roadway projects funded by the state I live in.

Being able to prove that you actually know what you're talking about is huge when you're competing against a bunch of college grads who only took computer science because someone told them it was where the jobs are.

#5278134 best way to write clean code

Posted by smr on 25 February 2016 - 12:22 PM

1. Do not litter your code with comments.
2. Do not trace log. It looks ugly.
3. Do not implement features that force you to compromise on the aesthetics of your code.
4. Avoid fixing bugs that require an awkward fix.
5. Ignore errors and exceptions. Error handling often stinks up your fresh code. Also usually involves one or more lines of trace logging.
6. Bury all logic in layers of abstraction. If a coder can look at a method and understand how it's doing what it's doing, then you've not abstracted enough.

#5276026 Best C# library for implementing graphic editor's functions

Posted by smr on 16 February 2016 - 04:25 PM

Have you confirmed that WPF or WinForms are not up to the task?

#5273948 Advice for a "decoupled" game engine

Posted by smr on 02 February 2016 - 04:03 PM

Be careful not to fall into the trap of writing layers of abstraction over an engine that is already one or more layers of abstraction itself.

Also, API coupling is a minimal concern, IMO, which is what you are looking to eliminate. Transitioning to a different API is a pain and takes time, but how much more time than building and maintaining additional abstractions up front that you're not even sure you'll need?

A concern that you should have beyond API coupling -- and in my experience is a bigger problem than API coupling -- is feature and pattern coupling. If you set out from the beginning to write a codebase that is decoupled from the engine, you will have to be careful to only use the subset of features of that engine you can be sure will be available in any other engine you may wish to transition to. Otherwise you will find it simply impossible to use another engine, or at the very least find yourself writing code of your own to replace the lost features.

#5272991 Weapon copyright?

Posted by smr on 28 January 2016 - 08:51 AM

I am not a lawyer, but if you have played GTA you'll notice there are a lot of vehicles that look very similar to vehicles you may have seen in real life. They even have similar names, or names that evoke the meaning of the real-life vehicle. My assumption is that Rockstar did this to avoid licensing costs and the headaches of negotiating licenses with all those companies. I would also assume that same logic would apply to weapons.

So avoid using trademarked names and logos. Also, I'm not sure if "design language" can be trademarked or under copyright. You should look into that too. Design language might be the unique styling of the tail lamps on a Ford Mustang, for example. Not sure if that even relates to weapons, but keep it on mind.

#5271180 Python for 1st language?

Posted by smr on 14 January 2016 - 06:09 PM

Before you make up your mind, I recommend you consider JavaScript. JavaScript, as you may know already, runs in your web browser which is a very capable platform for games. And there is no end to the number of game programming libraries and tutorials out there to get you started.


Plus, if you write something you want to share, all you need to do is host the files somewhere and share the URL. No one needs to download or install python. You don't have to mess with py2exe or anything like that. It couldn't be easier.


A great place to start is with phaser.

#5268485 How do I unit test complicated ideas?

Posted by smr on 30 December 2015 - 10:26 AM

It is difficult to write a test for each corner case in advance because, like you said, you typically don't discover them until after the fact. Once an issue like this is discovered I find that the best thing I can do is write a test for it which initially fails, then correct the bug so that the test passes. Going forward this test will ensure that if the bug is reintroduced it will be identified before it makes it into production or QA.

In general unit tests are not intended to test complex things. They should be testing small units of code with simple assertions, ideally one assertion per test. Sometimes this rule can be bent when to do otherwise is not practical, but that's not usually the case when code is well factored.

#5264067 Old MMOs on new Windows (10)

Posted by smr on 29 November 2015 - 03:16 AM

You may be able to run the application in a virtual machine which is running an OS version supported by the app. VMs generally don't perform very well for games, but as you want to play an old game the VM performance may be more than sufficient on current hardware.

#5255929 Drawing graphics in C++ w/out APIs?

Posted by smr on 06 October 2015 - 07:31 PM

You definitely can communicate directly with the graphics card in the same way that OpenGL does. If you're interested check out the source code for some of the open source graphics drivers developed for linux. The issue is that these drivers are very much hardware specific and will not work for chipsets from other manufacturers, and only for certain models of that chipset.


If you aren't concerned about OpenGL you can access the hardware with VESA or even VGA. VGA 320x200 was pretty easy to work with. I haven't done it personally since I was working with Turbo C on my 286...

#5249163 What do you guys use as a key in RPG data structures?

Posted by smr on 27 August 2015 - 07:25 AM

Wrapping usually means creating a class that exposes at least one of the same interfaces as the wrapped class does. That wrapper class will hold a reference to an instance of the wrapped class. When you call a method on the wrapper it will perform some additional behavior or modification to the arguments, then call the wrapped class method. The result will be passed back to the original caller, perhaps even being modified also. Wrapping is a way to add behavior to a class without modifying that class. You can pass around the wrapper instead of the wrapped class and consumers of the class will not know any different as long as the wrapped class still behaves in a way that is rational.

A contrived example would be a logging wrapper. You could wrap some class with your logging wrapper and pass that around instead. Your logging wrapper will log before and after any method is called. It doesn't change the result of the call as far as the consumer is concerned, except that it will slow the call down.

#5249087 What do you guys use as a key in RPG data structures?

Posted by smr on 26 August 2015 - 06:18 PM

An attack is an action, a verb.  You should not model verbs as nouns, or else you end up with anathemata like attack.do(hero, enemy) instead of a more natural hero.attack(enemy).  Attack handlers, attack events, attack objects:  what do those look like in real life?

Modeling your code components after real life, physical objects is, in my view, an antipattern. In a good design some components may conceptually align with an object in the physical world or the simulation you are creating, but whether or not a component correlates with one of those objects should not be a requirement. After all , what does a database transaction look like? What does a file stream look like? What does a dependency injection container look like?

#5248700 What do you guys use as a key in RPG data structures?

Posted by smr on 25 August 2015 - 12:45 AM

What's wrong with just having strongly typed fields? Will you be inventing new stat types at run time? I think that in the quest to build the I-can-build-any-game-with-my-custom-engine engine people go overboard with the dynamic data structures. That code isn't as reusable as you think it is. And you probably won't want reuse it anyway because you'll find 100 reasons during your first implementation that you'll feel it necessary to build your RPG engine 2.0 from scratch. Also when choosing to go dynamic, you're not taking advantage of the facilities of the c++ language such as static typing that will help you avoid some bugs and enables certain types of developer productivity tools like refactoring helpers built in to Visual Studio.

#5242392 Good Scripting Language for C

Posted by smr on 24 July 2015 - 07:48 AM

I wouldn't recommend embedding Python either. However if you are going to go the other route of embedding C/C++, Python is a great choice as it has a simple interface to compiled C code.

#5229959 Massive Python Example Script

Posted by smr on 19 May 2015 - 09:26 PM

Also if someone is going to use this for a reference it should be well indexed. If I need to scan through your mega script for more than 5 seconds to find what I'm looking for in going to google instead.

#5229941 Massive Python Example Script

Posted by smr on 19 May 2015 - 06:46 PM

It may be more effective to break it up into smaller, more concise scripts that are easier to digest.