Jump to content

  • Log In with Google      Sign In   
  • Create Account

mark ds

Member Since 07 Jan 2010
Offline Last Active Today, 05:36 AM

#5199040 Easiest coding language?

Posted by mark ds on 18 December 2014 - 07:31 PM

To Serapth

 

From Lua's Wiki: Lua is crap!

 

"Lua is a tiny and simple language, partly because it does not try to do what C is already good for, such as sheer performance, low-level operations, or interface with third-party software. Lua relies on C for those tasks. What Lua does offer is what C is not good for: a good distance from the hardware, dynamic structures, no redundancies, ease of testing and debugging. For that, Lua has a safe environment, automatic memory management, and great facility to handle strings and other kinds of data with dynamic size."

 

In  this modern age, battery life is just as important as absolute performance.




#5198350 Easiest coding language?

Posted by mark ds on 15 December 2014 - 10:42 AM

If you're starting from scratch, I'd have to seriously recommend downloading Visual Studio 2013 Community Edition, and learning C#. There are loads of online resources, but better still buy a good C# book.

 

After several months of hard graft getting your head around programming, look into using an existing game engine, such as Unity or Unreal (both of which can be used with C#).




#5197757 Scaling sprites with distance?

Posted by mark ds on 12 December 2014 - 06:48 AM

If you double the distance you halve the size.




#5196878 C++: Easiest way to implement an in-game Time/Date system?...

Posted by mark ds on 07 December 2014 - 06:40 PM

Don't use GetTickCount, use QueryPerformanceCounter along with QueryPerformanceFrequency.




#5195426 laptop for programming

Posted by mark ds on 29 November 2014 - 08:14 PM

How are you finding your Surface Pro? I'm very seriously thinking of getting one. (or maybe the Pro 4)




#5195093 laptop for programming

Posted by mark ds on 27 November 2014 - 08:58 PM

Don't forget that you can run  Windows on Mac...




#5195080 laptop for programming

Posted by mark ds on 27 November 2014 - 06:26 PM

What's your budget?

 

This being a game programming site would suggest you're looking at graphics capabilities. However, cheap laptops have crappy GPUs. If you're talking about general programming, I'd suggest a large 1920x1080 screen. Having more on screen really does help. Apart from that, *any* laptop can be used to programme.




#5195062 how to create gui buttons with DirectX 11?

Posted by mark ds on 27 November 2014 - 04:55 PM

A button is usually nothing more than a virtual rectangle that exists within the client area of a window. As the user moves the mouse just test whether the mouse is inside of each rectangle (perhaps using PtInRect). Now this doesn't help the user much, so you would also have to render some quads on the screen in the same positions using some kind of button texture - perhaps a 'normal' one and a 'mouse over' one. Something like

 

 

Attached Thumbnails

  • example.jpg



#5193735 Need a short name to replace a really really long function's name

Posted by mark ds on 20 November 2014 - 01:22 AM

SetPosByOrigCenterOnEvent

glDrawElementsInstancedBaseVertexBaseInstance

 

You function name isn't even that long compared with the gl function above. However, the point of function names is to be descriptive, irrespective of how long they are. If you come back to this code in 5 years will you be able to tell exactly what the function does without any comments? If not, rename it to something more meaningful.




#5193454 Text dissapearing when resizing or minimizing window.

Posted by mark ds on 18 November 2014 - 10:27 AM

Also, there should be a "break;" at the end of WM_PAINT, because at the moment the code falls straight into WM_SETFOCUS. It's a pretty shoddy code example from MSDN, to be honest.




#5193452 Text dissapearing when resizing or minimizing window.

Posted by mark ds on 18 November 2014 - 10:20 AM

In WM_SIZE the code

 

 

if (pTextMatrix != NULL) free(pTextMatrix); // If there is enough memory, allocate space for the  // text input buffer.
pTextMatrix = (char*)malloc(nWindowCharsX * nWindowCharsY); 

 

deletes all of the text you have entered, and then recreates pTextMatrix based on the number of characters you can fit in the client window. You need to move the allocation/de-allocation somewhere else (possibly allocate in WM_CREATE and de-allocate in WM_DESTROY).




#5192741 Optimization in C#, code too slow and help with translation

Posted by mark ds on 13 November 2014 - 05:12 PM

Your memory access pattern is the problem.

 

In your code you're doing:

 

for(x = ....

    for(y = ....

 

which is always a bad idea. Change it to:

 

for( y = ....

    for( x = ....

 

This maximises cache usage because of the way the bitmap is stored in memory.




#5192733 Corrupting of the view if far from world center

Posted by mark ds on 13 November 2014 - 04:17 PM

Never move the camera around the world - move the world around the camera. For example, if you are walking north along a terrain, you'd actually move the terrain south. This gives you maximum floating point precision where you need it - up close.




#5192344 I want to do a game with this sprite sheet

Posted by mark ds on 11 November 2014 - 07:49 PM

 

This is the idea i had when i started everything when i was bored.

 

Commitment Is what you need, not bored ideas...




#5192286 Scene Graph + Visibility Culling + Rendering

Posted by mark ds on 11 November 2014 - 11:53 AM

Two things spring to mind here:

 

1: If you're rendering from a basic grid, just compare the old bottom left grid ID (x:y pair) with the new ID, and compare the old top right ID with the new ID - if they are the same, just render from the previously sorted (and cached) list. There's no need to do any work at all, expect for dynamic objects. It's only when the camera move sufficiently do you need to recreate your list.

 

2: Better still, instead of having a single grid based structure which holds ALL entities, have multiple structures - one for each entity type (buildings/rocks/trees etc.). This way they are effectively already sorted by shader/textures combinations. HINT - this makes for an ideal job based multithreading solution, where each structure gets managed as an independent unit.






PARTNERS