Jump to content

  • Log In with Google      Sign In   
  • Create Account


smr

Member Since 16 Jul 2004
Online Last Active Today, 10:19 AM
-----

#5166289 would you create an Android-only game

Posted by smr on 11 July 2014 - 02:38 PM

No, since there are a few frameworks that enable you to target multiple platforms without too much effort. Marmalade (c, c++, or lua) and Cocoonjs are decent.


#5165256 Communicating "scariness" without openly showing the enemy

Posted by smr on 07 July 2014 - 08:15 AM

That would be another thing you could do: cause the environment to rot and decay in the area of the monster. Plants shrivel and die, wood rots, paint peels away, metal rusts, etc.


#5165254 Communicating "scariness" without openly showing the enemy

Posted by smr on 07 July 2014 - 08:11 AM

If the monster is supernatural, you could do something to change the environment depending on how close the monster is. Think Harry Potter's dementors: a local area of effect freeze of the environment. It would be cool if you could use vertex shaders to cause plants to shrivel up and die.


#5157933 WebGL engine?

Posted by smr on 03 June 2014 - 02:53 PM

What sorts of things have you found to be missing from Three? Is it possible you're implementing features that aren't typically the responsibility of a 3D engine?


#5144440 Estimating the revenue of a mobile game?

Posted by smr on 04 April 2014 - 03:05 PM

Add up your costs, then multiply by negative one. That's your revenue estimate.

Until you have sales or presales data you cannot possibly extrapolate revenue. There's nothing to extrapolate.


#5142998 Browser-Based Game: Best Language?

Posted by smr on 28 March 2014 - 10:11 PM

I also must disagree with Karsten about staying away from jQuery. Jquery is very well supported by current AND older browser versions going back to IE 8. If you want prior to IE 8 support that is available too by using the 1.9 branch of jQuery. Its API is the same as the 2.0 branch but with the cruft for crappy browsers left in. Keep in mind that using jQuery electors does incur overhead, so be sure to cache them and to profile when you suspect jQuery might be a performance issue. My experience is that in the few cases when jQuery is a bottleneck, caching selectors or direct DOM manipulation closes the gap. Use jQuery when it helps (95% of the time), and direct dom when it doesn't. Simple.


#5142996 Browser-Based Game: Best Language?

Posted by smr on 28 March 2014 - 10:03 PM

I recommend JavaScript with node for the server side. All you need is a text editor (notepad++, gedit, etc.).

As far as compatibility, you're OK. All modern browsers support canvas (2D context, not webGL) and JavaScript. The challenge is performance, screen size and input. Three of the four current versions of the popular browsers (Firefox, Chrome, Safari) perform pretty well on the desktop and mobile. Of course IE lags behind but is still OK for all but the most demanding of work, such as fluid Canvas animation.

Obviously the physical size of the screen and whether or not there is a keyboard or other physical input device attached will have a strong influence on how your game will be experienced on different platforms.


#5142746 Browser-Based Game: Best Language?

Posted by smr on 27 March 2014 - 08:07 PM

In the browser itself, barring plugins, you're pretty well limited to JavaScript. There are other languages you can use which can be compiled to JavaScript, but you can't escape the semantics of JS, so any such language is more or less syntactic sugar. They may add some static analysis, but my experience with TypeScript and CoffeeScript has been they are not worth the trouble.

For the server your choices are far more vast. Most contemporary languages have a web app stack (rails, grails, django, flask, ASP.NET MVC, sails, meteor...) that will help keep things organized and prevent you from rebuilding the wheel.

If you are new to programming or have absolutely no bias I'd go with Node.js along with one of the popular full stack frameworks like express or sails. This way you need only learn one language, and there's a chance you could share some code on the client and server side, though this usually is a minimal amount.


#5125356 Is HTML5 a legit language for developing game?

Posted by smr on 21 January 2014 - 08:52 AM

Overall my experience using HTM5 has been positive. That being said, the issues I have experienced are due to the Canvas not cooperating with what I want it to do (for example, no way to disable min/mag filter when scaling images), JavaScript performance which is overall quite good on the desktop, but varies wildly on mobile as you could imagine. And also the difficulty in managing a large codebase in a dynamic language.


#5100823 BASIC

Posted by smr on 12 October 2013 - 11:02 AM

Any instructor who says "NEVER" use GOTO  may never have done much serious programming  (where they are very useful for abnormal exiting of complex subroutines,  and the horrors of number goto labels are long gone)


I've been programming for 20 years, professionally for 12, and I can say this is the first time in probably about six years that I've typed the four letter sequence "g o t o". When I did use goto, it was always preceded by "on error", because that's the exception handling idiom in VBScript - "On error goto label". I program at least 40 hours per week.


#5094440 Correctly casting serialised objects

Posted by smr on 16 September 2013 - 07:31 AM

Too much. You need a factory that can select the appropriate class based on the int type code. This class can instantiate the specific message class using a parameterless constructor. A switch statement is not a terrible way to go when selecting the class to create. Then the payload is given to the message class's deserialize method. That's all.


#5092744 Stick with C++ or venture into C#?

Posted by smr on 09 September 2013 - 10:17 AM

I would recommend using C# with one warning: Have a plan. If you know ahead of time you know what you're going to do, you'll be able to make the decision to use C++ in those narrow range of circumstances when C# would not be suitable. It sucks to have hundreds of hours into something then realize you're at a dead end.

 

* C# is inconvenient on your target platform: iOS, Android, Blackberry

* Some third-party library does not support .NET, or some third party tool you want to use produces files in a proprietary format, and the libraries to read the format are not available to C#.

* C# performance, for example, you need very tight control over memory allocations, layout, etc.

 

You can get around each of these issues if you just have to use C#, and the performance is not likely to be a bottleneck except in the most demanding of games.




#5091711 Why are static variables bad?

Posted by smr on 04 September 2013 - 11:31 PM

RAII :)


#5091654 Why are static variables bad?

Posted by smr on 04 September 2013 - 03:58 PM


Personally I like to make objects that can always be default constructed and design paramaters as simply ways to set specific properties on creation. I'm not really a fan of objects that do complicated behavior just by being created.

 

Just because you are passing dependencies to the constructor does not mean that the constructor is doing anything more than storing a reference to those dependencies. It doesn't have to use them or access them in any way.

 

 

 


The problem with that is you're assuming it is an object that is useless without its full set of data and useful with it. Which in reality is not the case most of the time, especially concerning games. A good example might be a game entity, say you wanted to create it and set certain data about it and then add it to a world. Should it ask for a world and add itself in the constructor? Well it could but that means you have to add it to the world the second you create it, it also means you are essentially required to pass all of the information the object needs into the constructor and to also assume it is all correct.

 

The constructor is not the only place to inject dependencies, it's just a convenient and fail-safe one. Obviously if you need a parameterless constructor, or otherwise need to construct an object before you have a reference to its dependencies, or that dependency is not available within the scope that it is being constructed, then you'll have to use another means. Personally, in the case of game objects, I typically require the "world" reference as an argument to any methods that depend on it, likewise for any other dependencies. The parameterless constructor is needed for deserialization and/or constructing entities to add components to via configuration files or using some sort of fluent interface.




#5091452 Why are static variables bad?

Posted by smr on 03 September 2013 - 06:39 PM

 


and every constructor will have like 5 arguments

 

And if you do need to pass in five dependencies to one constructor (which is extremely unlikely if you design your classes properly), you can always wrap them in an instance of a FooContext class.

 

 

There's nothing wrong with a constructor having five arguments per se, if that class has five dependencies and/or required parameters. If your class genuinely has five dependencies, passing them to the constructor is better than the alternative of global variables. If your class feels like it has too many dependencies, maybe it really does and needs refactoring. That's going to be a judgement call based on the specific situation.






PARTNERS