Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 17 Jul 2002
Offline Last Active Yesterday, 09:54 PM

#5293272 why i don't get the HBITMAP from file\resource?

Posted by ApochPiQ on Yesterday, 04:47 PM

This is the same problem you had with icons. The correct resource type is called "BITMAP" not "bmp".

#5293071 c++: sprintf but return chars. Possible?

Posted by ApochPiQ on 23 May 2016 - 10:30 AM

What do you mean "if it fails"?
What i do now with sprintf could then also potentially fail no? I just want to compress the code i need to write. I end up in many such situations (must create a temporary char array that i inject floats and other stuff with %.2f etc and then pass it to a function that takes a "char *" parameter).

The best way to solve this is with a string class of some kind. Otherwise you're going to have a nightmare cleaning up all the heap-allocated temporary strings. Honestly, I think you're pushing the laziness lever a little too hard here. I'd be shocked if your actual coding bottleneck was declaring temporary char arrays.

#5293070 Animal-like AI

Posted by ApochPiQ on 23 May 2016 - 10:22 AM

This is the wrong way to go about building a model of a simulation.

You need to start with concrete requirements - i.e. specific things that you want the AI to do. What does it even mean to have the emotions of a dog or cat? How does that influence their behavior? How will the player observe these simulated emotional states?

Those are the kinds of questions to begin with. Once you know what the observable effects of your AI should be, it becomes much easier to build a model that actually produces those effects.

What you have now is... ambiguous, I guess. Maybe it does what you want, maybe it doesn't. But cramming features into a code sketch is not going to get you a good result either way.

#5292983 Wrapper Function for lua_register?

Posted by ApochPiQ on 22 May 2016 - 10:08 PM

A quick google search turned up this: http://stackoverflow.com/questions/32416388/how-to-register-member-function-to-lua-without-lua-bind-in-c



Might be handy?

#5292701 can a generic engine do something like skyrim?

Posted by ApochPiQ on 20 May 2016 - 03:39 PM

Don't underestimate the third option: modifying a prebuilt engine.

Saves the up-front cost of building an engine, avoids the problems of genericity for the most part, and generally gives you fine-grained control over the build-vs-buy decision.

#5292310 how can i use the CreateTimerQueueTimer()?

Posted by ApochPiQ on 18 May 2016 - 11:46 AM

I am extremely skeptical that CreateTimerQueueTimer is crashing your program.

Follow these directions to diagnose your crash.

As for the timer itself, I cannot stress enough that you should read the documentation (here). You're using the interval and due-time parameters in a way that does not indicate that you understand how they work.

#5292202 Quadtree/Octree on ramp

Posted by ApochPiQ on 17 May 2016 - 09:45 PM

Why can't your quadtree accommodate inclined quads? Most implementations handle arbitrary polygons effortlessly...

#5292190 Quadtree/Octree on ramp

Posted by ApochPiQ on 17 May 2016 - 07:47 PM

Recast voxelizes the world and uses that data to generate a polygon soup that is refined into the navmesh.

Is that what you want to do? Or something else? I still don't follow what you want the quadtree to be doing here.

#5292175 how can i use the CreateTimerQueueTimer()?

Posted by ApochPiQ on 17 May 2016 - 05:19 PM

You're being very unclear about what you are trying versus what you are expecting. I can see your code fine but I have no clue what you want to happen here.

It's very hard to diagnose a problem when the problem is not specified ;-)

#5292154 how can i use the CreateTimerQueueTimer()?

Posted by ApochPiQ on 17 May 2016 - 03:18 PM

That's not a memory leak, that's a crash. Use your debugger.

As for interactions with multithreading, read the documentation - there are many potential pitfalls.

#5292147 how can i use the CreateTimerQueueTimer()?

Posted by ApochPiQ on 17 May 2016 - 02:55 PM

How are you detecting the memory leak? Most tools will point you to the faulting allocation. If not, get better tools ;-)

When you say the interval seems faster... faster than what? What resolution are you expecting/getting?

#5292116 Need mentorship from a veteran programmer

Posted by ApochPiQ on 17 May 2016 - 12:57 PM

If your resume seems to be the thing that is costing you opportunities, I'd suggest starting with a resume review. There are plenty of people here who will offer free thoughts on your resume.

My suggestion would be to post an anonymized version of your resume (i.e. personal contact details omitted, name, etc. removed, and so on) and let people have a glance. If you're not comfortable doing that I'd be happy to get you some private feedback.

#5292113 how can i use the CreateTimerQueueTimer()?

Posted by ApochPiQ on 17 May 2016 - 12:52 PM

Start with the documentation. In particular your interpretation of the return value is wrong.

#5292093 Quadtree/Octree on ramp

Posted by ApochPiQ on 17 May 2016 - 11:12 AM

What is your tree attempting to accomplish? There are many options but the tradeoffs depend on what you want to do with the partitioning structure.

#5291487 Link Outside Library in VS2013

Posted by ApochPiQ on 13 May 2016 - 10:40 PM

You need your main project to link to the .lib file that you generated.


The best way is to make the lib project a dependency of the main project (Project menu -> Project Dependencies... and set up the main project to Depend On the lib project). Then make sure your main project has the Link Dependencies option enabled (Project properties -> Linker section -> set Link Library Dependencies to Yes).



That should fix the problem.