Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


MajorTom

Member Since 01 Jun 2009
Offline Last Active Jul 26 2014 05:34 AM

#4950363 Structure of classes in good Game Engine?

Posted by MajorTom on 18 June 2012 - 02:17 PM

If it's used everywhere, make it global. Some people fight to the death to ensure there are no globals in the code... but sometimes, globals are necessary, and it keeps the code interface nice and tidy. (Don't use globals everywhere though, since they can be a pain to track when debugging)

Using inheritance isn't "bad" all of the time, only when it's abused, like any other tool.
At the moment, try focusing on implementing the game, and think less about the engine. You'll learn a lot about what you really need the engine to do from making a game.

Hope this helps :)


#4940752 WKPDID_D3DDebugObjectName link error

Posted by MajorTom on 16 May 2012 - 02:13 PM

Hi,

I'm not sure if you guys solved this problem, but I've just stumbled across this exact same issue.

The solution is to link with dxguid.lib. If you're lucky enough to be using a recent version of Visual Studio, you can do this in-code like this:

#pragma comment( lib, "dxguid.lib")

I thought I'd share this here, since there were only three search results in google - and it didn't seem to be mentioned elsewhere.


#4915112 Projectile Motion

Posted by MajorTom on 21 February 2012 - 02:03 AM

//Projectile.cpp
#include<iostream>
#include<string>
#include "Projectile.h"
void Projectile:setName(string n){
m_name = n;
};


The code above keeps spitting out error C2628: 'Projectile' followed by 'void' is illegal (did you forget a ';'?) for projectile.cpp Line 8 and error C2556: 'Projectile Projectile::setName(std::string)' : overloaded function differs only by return type from 'void Projectile::setName(std::string)' for projectile.cpp Line 8.


You've missed a colon ":" before setName().

Edit: Also, you've missed a semi-colon at the end of your class definition in Projectile.h (it happens to the best of us)


Also, also, seeing as you've made the member variables public in the class, you don't need getters/setters. Also, also, also, this is just a hunch, but should the UpdatePosition() really be taking time as an integer? I have no idea how your system works, but if time is in milliseconds, then m_speed would have to be incredible low...


#4890846 Casual vs Dress interview

Posted by MajorTom on 05 December 2011 - 03:52 PM

Speedos.


Just say putting on clothes took too long, so you optimized them out. You could probably mention it's a multi-threaded speedo too.


#4881303 Expecting calculation to be 0

Posted by MajorTom on 07 November 2011 - 01:46 AM

I'm roughly familiar with epsilon comparison, but I was under the impression that it was a far smaller threshold than -1.5 (the value in question)? I'm also a bit confused as to how comparison relates to my problem when there are none taking place. If it was a smaller number (ie < 1), I'd understand...


The value -1.5308086E-15 actually represents something like -0.0000000000000153 - which is rather close to 0.

You can think of the "E-15" as a shift of the decimal point. Its a short hand notation for extremely large or small numbers.


The previous posters have linked some nice resources, especially rip-off's post.




#4855065 What games would you most like a clone of?

Posted by MajorTom on 29 August 2011 - 08:40 AM

Old-school Metroid. That's my next big project.

Though I really enjoyed Metroid Prime (and Metroid Prime 2), I loved the atmosphere of the game - and the blend of platformer action with puzzles.
The entire game, as an experience - has made it one of my most favourite games.


#4822302 Read/Write from/to a texture WITHOUT using DX11 UAV's.

Posted by MajorTom on 12 June 2011 - 12:23 AM

how do you read the position texture, read the velocity texture, and update the position in the same pass?


You could copy the position texture from the last frame into a current position texture which is sampled - whilst rendering to the original position texture - this would (sort of) remove flip flopping ( but not really ).

e.g
  • Render Position to texture A.
  • Copy texture A to texture B
  • Set texture A to as render target
  • Sample position from B
Though this doesn't minimize memory usage at all. Additionally, during step 2, the copy will need to have texture B set as a render target, while texture A is sampled - so the flip-flopping is still there.


#4813572 If you could see any movie made into a video game

Posted by MajorTom on 20 May 2011 - 12:58 PM

The Butterfly Effect

I'd love to play a game where you go deep into the past and change things that completely alter the reality of present day.


#4809865 Use const!

Posted by MajorTom on 12 May 2011 - 11:46 AM

I once saw code like this:

const int Zero = 0;
const int One = 1;
const int Two = 2;
const int Three = 3;
// ... etc

It continued up to 20.Terrifying.


#4788309 how long will a change in the past take to affect the present?

Posted by MajorTom on 20 March 2011 - 12:52 PM

This thread's a little heavy for a gamedev forum, isn't it?

Unless we're talking about Braid.
Great game.


#4762139 Proof God doesn't exist?

Posted by MajorTom on 20 January 2011 - 06:18 PM

I'm an atheist. ( It's not that scary, is it? I mean, have you played Amnesia? That's way scarier... )

Yet, I believe that "God" exists.
The concept of God lives in the mind of the believers of "God", much like Father Christmas.
There is no hard evidence of God, as we don't yet have the technology to prove the concept.

Interestingly, perhaps God exists in another sense; perhaps this world/universe is a prison or rehabilitation, or even a school.
Imagine the possibility of there only being one concious life, "God", yet the universe is populated by uncountable lifeforms.
Perhaps, in this situation, God is to live the full life of each lifeform in turn, which exists, will exist, and has existed, to better itself.
Perhaps this is a simulation, inwhich all of this happens in the blink of an eye.

Or perhaps, it's just us, and despite being incredibly lucky, we managed to somehow survive the onslaught of chaos in the universe.
Humans could be around for millions of years still, with technology beyond belief... yet everyone on this planet today will be dead in 150 years.

Life is short.

So, have fun, and make lots of fun games. :)


PARTNERS