Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 May 2011
Offline Last Active Today, 07:12 AM

#5262664 read records from database with index using entity framework

Posted by on 18 November 2015 - 06:03 PM

As fastcall22 said.

More precisely you can apply paging using "skip take". For example:

// things are of type DbSet

var pageSize = 10;
var page = 2; // passed in from view

var pagedResult = things.AsQueryable().Where(thing => thing.IsAccesible).Skip((page - 1) * pageSize).Take(pageSize).ToArray();

#5234395 C# becoming obsolete ?

Posted by on 11 June 2015 - 11:00 PM

I do not know your sources, but C# and .NET is anything but dead. The revolution you are reffering to I would say is pretty much restricted to JavaScript, with it now being available as a server side tech.

If there is any tech that is getting obsolete it is Java, wich is having a hard time keeping up with C# and .NET. It will still hang around for 50+ years though. (Companies still support old Cobol mastertdata systems because of legacy code)

My advice would be to explore different (web - since this seems to be your focus) techs with a focus on .NET (MVC) and JavaScript.

#5231835 Looking for Multiplayer 3d game engine with tools

Posted by on 30 May 2015 - 07:29 AM

Obviously, you are not looking for a 3d engine, since you've already found and dismissed two of the greatest and most affordable ones out there.

What you are looking for is a free ride, and that does not exist in the game dev industry.

I invite you to be a bit more realistic. Game development is crazy hard. But it also super rewarding. If you are willing to stick with it even when it gets hard.

Continuing looking for this "perfect" solution is setting yourself up for dissapointment. (I know since I've done it.)

#5223230 PerfectMMORPG

Posted by on 14 April 2015 - 03:03 PM

"return of the retarded"...

Troll much?

#5213190 Architecture vs Performance [Android game]

Posted by on 26 February 2015 - 03:09 PM

We can't tell you much without seeing the full code.

I didn't start writing a game code yet. I only think over implementation.

Premature optimization is the root of all evil.

Well maybe not, but on a more serious note; you should focus on getting a sound architecture and deal with any potential performance related issue when (if) it comes. Truth is you don't know enough about any potential issue to solve it until you've seen it. You are just as likely to introduce problems as you are to fix them should you do it now.

#5205978 Encapsulation through anonymous namespaces

Posted by on 22 January 2015 - 07:41 AM

Thanks guys!


However, the 'there can only be one' and thus the singleton/global-state is a code smell. Why dictate that the library has to have a single global state and restrain it like that if you don't have to?


This is something I have been thinking about a lot.
For example; in a thread discussing something related, someone talked about using multiple instances of a rendering engine for debugging purposes.
This is a very valid point and I am taking this into consideration.
One approach I am considering is encapsulating all state-related information into a class or struct, say "Renderer", and leave the public interface as free functions (with anonymous "helper" namespace):
namespace // private helper methods and variables (constants etc)
    int DrawHelper(const RenderAPI::Renderer& renderer)
        return renderer.GetSomething();
namespace RenderAPI // public renderer API
    class Renderer
            int GetSomthing() { return _something; }
            int _something;

    Draw(const Renderer& renderer)
Which seems like a good tradeoff to me.. Think this would be overengineering?

#5202780 Handmade Hero discussion thread

Posted by on 08 January 2015 - 03:28 AM

Watched the first episode yesterday after hearing Jonathan Blow talking about him (which I guess is not so weird, now that I know he was a coder for "The Witness") and was pleasently surprised.


Personally I am pretty good at coding, but very bad at everything "around" coding, such as build systems etc, and it looks like he is covering stuff like that, so I will continue watching it. =)

#5194383 Entity Component System - Accessing Components

Posted by on 24 November 2014 - 05:18 AM

Since you do not describe how you are defining and using your components (other then that they are accessed through a method), it is hard to give any direct advice as how to store and access them.


There are many forms of entity-compoennt systems - some where an entity an object with a list of components and others where an entity is just a an id and the components are stored in seperat lists and accessed through that entity id.


I am personally using an approach based on the latter (where an entyity is represented by an id) since I like the simplicity and performance of that method,

I also think its very readable, but it can be a bit hard to wrap your head around initially if you are more used to the object oriented style of programming.


I started out by following some great articles here on gamedev:






Have a look and see if that is something you could use maybe.

#5194307 Problem with perspective in opengl

Posted by on 23 November 2014 - 01:57 PM



I was passing GL_CW instead of GL_CCW to glFrontFace()... it works fine now!


I can also tell that when i thought i was rendering it correctly (using inverse of aspect ration) it was acutally rendering it from behind, which I guess is why glFrontFace(GL_CW) worked.


Thanks a lot!


(for any future reader having this problem, these are the flags I set to get the model to render properly)



#5126717 SDL_CreateTextureFromSurface issue

Posted by on 27 January 2014 - 07:43 AM



Maybe you are confused by my code, i declared load_imge to return a bool, which mas a typo, it should return a Image object and the loader class should be separate from any other class.


An example:



class Window
    SDL_Renderer* get_renderer() { return _renderer; }
    SDL_Renderer* _renderer;


class ImageLoader
    Image const& load_image(SDL_Renderer*, std::string const&);


  Window window;
  ImageLoader imageLoader;
  Image image;
  image = imageLoader.load_image(window.get_renderer(), "foo.png");
  if (image == nullptr)
    std::cerr << "Could not load image" << std::endl;

Or something like that, sorry for any confusion i might have caused.

#5126296 Can someone help me think of a creative name for my puzzle/tower defense game?

Posted by on 25 January 2014 - 05:34 AM

First of all, I agree with jbadams that it's a nice concept you have for your game!


There are some tower defence games out there that have pretty generic names, but I still remember them of the top of my head, like desktop tower defence, bloons tower defence. These games are just regular tower defence games though. You probably want a name that captures the spirit of combination of "match 3" with tower defence.


I dont have any concrete names for you, but a method that can help you come up with your own name is to write down words that represents each genre in two columns and then try different combinations and variants. You can use more columns if you want to incorporate more names, like your business name etc.


Good luck.

#5125113 Is HTML5 a legit language for developing game?

Posted by on 20 January 2014 - 12:50 PM



Developing games in HTML5 has a lot of advantages over other environments/frameworks/languages, such as platform independant distribution (the browser is the patform) and no downloads required to play the game etc.


The things that I found to be bothersome is that there are some things that you, as a developer, cannot take full control over, such as mouse lock and fullscreen mode etc. There are API's for this, but as far as I have been able to discern, they do not quite simulate the same behavior as native applications, as far as control is concerned.


I guess it depends on what kind of a game you want to develop.. I have found that HTML5 games (or browser games in general) are more accessible - just navigate to the URL of the game, but at the same time it is just as easy to stop playing - there is no "investment" in playing the game.. which would probably affect how the game is played.. (favors shorter playing sessions etc)


PS. HTML5 is a collection of techniques in HTML, CSS and JavaScript, and not a language

#5125051 Help

Posted by on 20 January 2014 - 08:32 AM

I agree with wath BitMaster said.


It should also be said that it is possible to design and create games without much programming at all, using an engine or software such as Unity or GameMaker.

Haing said that, personally I would do pretty much as what BitMaster suggested.

#5125008 sandbox openworld survival game *to quest or not to quest

Posted by on 20 January 2014 - 04:52 AM



I don't have a good answer to your specific questions, but one "rule" that I think goes a long way in game design is that "doing one thing really well is always better than doing many things half-assed". This is true for many popular games that builds around a simple concept and delivers really well within that concept.

#5124426 Is using Java a good way to create a game?

Posted by on 17 January 2014 - 10:44 AM


Java is fine as any other language to make your first game, but a RPG game isn't in my opinion.

That's a rather particular genre that this general purpose language can't seem to handle correctly. Why do you think so?



He was probably referring to the "make your first game" and not the coding language ^^ (as in a RPG might not be the best genre to try as your first language) I don't have any opinions on that though.


Edit* Maybe you were just making a joke boogyman.. Wouldn't be the first (or last) time sarcasm got the best of me over the internetz lol