Jump to content
  • Advertisement

caesar4

Member
  • Content Count

    197
  • Joined

  • Last visited

Community Reputation

100 Neutral

About caesar4

  • Rank
    Member
  1. This is one of the weirdest errors I've come across I subversion everything I have so when I when to an earlier version where lighting DID work, I still got the exception anyways it happens when I try this.pDev.Lights[0].Diffuse = Color.White; this.pDev.Lights[0].Type = LightType.Point; this.pDev.Lights[0].Position = this.vecLightPos; this.pDev.Lights[0].Enabled = true; this.pDev.Lights[0].Update(); and the exception is IndexOutOfRangeException, but the problem is, the Device.Lights property is read only, so I can't create it, and I cant add lights to it
  2. how do i find the virtual memory range taken up by my code? the idea is to invoke VirtualLock() on that memory range, such that windows does not move it to the page file, in other words, i want to lock the code (instructions) of my app in RAM
  3. in older versions that can sometimes be fixed by including those headers in your project
  4. well, the only thing compile time is the determination of the allocation calls, in what source files and on what lines allocations are made (__FILENAME__, __LINE__) all else is runtime and doesnt require a strictly define program flow the idea is that even in a dynamic workflow theres is quite a bit of predictability
  5. ok... last time i posted something about writing my own memory manager, you guys laughed at me like seasoned pros, telling me to beat it or to use boost::pool now...however, the prideful folk of you might wonna stfu and listen carefully, since there ARE some GREAT benefits to having your own memory manager mainly because it can LEARN!!! when i complete my code, and if i feel generous ill try to write an article for the masses but for now here is how it generally works -using the windows heap functions, allocate a chunk of like 64 or 256 megs or any other ammount -when trying to allocate something, rather than recieving a pointer, you recieve a handle. then, only when you actually need to read or write to that memory, you lock the handle to recieve a pointer, and then unlock when done. this allows the manager to move around chunks of memory, to fill in gaps and etc. -also, when you are allocating something, you give the manager certain flags about the allocation (can that block be optimized or should it be left alone, is it multithread accessible and can there be multiple locks, what kind of an object is it [application specific], can it be copied from memory to disk, etc) -each place in the code where an allocation is called (allocpt {source file, line}) is logged. each handle is associated with an allocpt -each allocpt keeps its own statistics (# of allocs, # of frees, min alloc size, max alloc size, avg alloc size, max running allocs, avg running allocs) -seperately, the manager keeps the same statistics for blocks of different sizes (1-127 bytes, 128-512 bytes, 1-4 kb, 2-8mb, etc) those statistics are KEY, since at the end of the program, the manager can save them to disk such that when you run your app again, the memmgr can load those stats and know what to expect say you have some loop that allocs an object and then releases it and repeats. with alloc statistics, the memmgr can speed things up since it can sense things of that nature for any that think this is tedious to use, that can be greatly changed through the use of templated smartpointers/smarthandles and through a couple #defines comments, suggestions, improvements are welcome
  6. caesar4

    cpu usage %

    Quote:Original post by Spoonbender If you have a low-priority process, it pretty much by definition won't hog the CPU. Windows always runs the available process with the highest priority. Your app will *only* run if everything else keeps yielding the cpu. the thread sometimes needs to be background, sometimes, it needs to hog ondemmand a low priority thread is out of the question, since this is regarding a memory manager that can and does move objects around, so a low priority will slow down other parts of code that need the manager to quickly finish its current operation already implementing the sleep approach, but i need variable sleep, depending on cpu usage no more anything about setting the thread to low priority please
  7. caesar4

    cpu usage %

    Quote:Original post by Agony GetProcessTimes() GetThreadTimes() thank you thank you thank you now, how can use that to get the idle percent? i know i need to use the kernel and user times deltas, but how do i find the kernel and user times for ALL processes combined?
  8. caesar4

    cpu usage %

    Quote:Original post by Lukewarm Theoretically you could write your own code with timers, and to get the percentage, you would just divide the time elapsed by the time your thread is active. thats not what i need to do nor will it give what i need Quote: But why are you trying to do this? i have a low priority background task that i wonna run such that it doesnt hog the cpu from other procs for that i need to be able to find global processor usage, processor idleness, and etc.
  9. how can i find what fraction of the processor goes idle, and what fraction is being used by my process, and what fraction is being used by a specific thread in that process? i know this is possible without a profiler, since procexp from sysinternals can do it for other processes
  10. caesar4

    Calculate delta time into energy loss?

    im assuming that 98% means, that you actually retain 98% of you energy and loose only 2% so in that case what you should have is this: energyPercentDeltaRate = -.02; // percent change per sec // this value can be anything energy*= 1.0 + energyDeltaRate*deltaTime; // that missing 1.0 is whats been throwing you off unless i'm interpreting your problem wrong, this should solve it
  11. caesar4

    Don't let them crack your game!!

    http://www.joachim-bauch.de/tutorials/load_dll_memory.html/en well, i remember that when my brother broke my halo for pc disk, i put the game exe through IDA, my efforts we completely futile but i learned something the way halo was packed was: you had the actual game file packed and encrypted, stored as a resource string into the the exe. where the exe would basically decrypt the game, store it to a temporary file and run that temporary file, which would check back if the decrypter part was there you could do something like the halo method or another idea: each time the user comp downloads the game dll, your download server could change a couple bytes in the dll, say the value of some const int somewhere in the code, then the client sends that value along with a CRC of the changed game file to the server for authentication again, you cant make something crackproof WHERE THERES A WILL, THERES A WAY instead what you can do is make too much work both, for crackers AND users to mess with your game: players will get tired if they have to apply a different crack every day
  12. caesar4

    Don't let them crack your game!!

    i remember reading an article on loading DLLs directly from memory (the code in the DLL never touches the hard drive) with that in mind, you could easily have your non game logic/authentication situated on the client computer and when the player attempts to run the game, he basically starts a small program that just goes out to the server and downloads the game as a DLL having that ability to run a DLL straight from memory for once, eases game updates (not content updates), and it could thwart cracking attempts. say, you recompile or somehow change the downloaded file on a periodic basis, and configure the server software to work only with the newer version that wont crackproof your game, but it sure as hell will make it a real catus in the rectums of the crackers. having to recrack it on a daily basis might fuck their morale enough to stop. just a though
  13. caesar4

    Managed memory in C++

    not exactly what i had in mind heres basically what i wonna know int *buff = (int *) malloc(size); int *ptr1 = buff+offset; //int *ptr1=buff+offset+alignoffset; how can i check if ptr1 is 32 or 128 bit aligned? how can i calculate alignment offset, such that ptr1 is 32 or 128 bit aligned?
  14. caesar4

    Managed memory in C++

    memory objects themselves can't be fragmented, but memory itself can get very fragmented, with unusable memory between allocated chunks and the way certain components work, those unusable memory chunks add up to quite a bit plus, having such a manager will allow me to gather statistics on certain objects and btw, my question wasnt on the practicality or feasability of my manager, but on alignment how can i check and align a memory address to a 32 or 128 bit boundary?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!