Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

184 Neutral

About davidx9

  • Rank
  1. At the command line "your_app.exe something.file" In windows, drag a file onto your binary. From your compiler environment, specify "command arguments" in some run-time debug menu somewhere. You will simply be given string information. You must parse this and do what you like with it.
  2. davidx9

    How To: Simple AI

    I would suggest calculating a vector based on the position of the enemy ships and all other objects on screen. The magnitude of this vector would be equal to "threat". Summing all of the vectors would give you an approximate direction of the greatest threat. Normalize, this vector, and then move in the opposite direction. By adding coefficients at varying stages of your computation, and perhaps some sort of low-pass temporal filter, you could characterise the AI quite easily. i.e response time, pilot-skill etc etc.
  3. davidx9

    Cache Locking in C++

    Quote:Original post by Jan Wassenberg Quote:and its explicitly (hinted) stored there using the intrinsic __mm_fetch(...,HINT_NTA). You probably mean _mm_prefetch(address, _MM_HINT_NTA). In which case this is really funny - a way has been found to guarantee your data is "locked" OUT of the cache :D The "NT" hint means nontemporal. Assuming the prefetches arrive in time, they will only be copied into L1 and not L2/L3. Since your working set is larger than L1d (even if it's only a single 64KB matrix, there are probably a few register spills/stack accesses), L2 accesses will be required. If you're lucky and AMD's exclusive cache policy results in L1 victim lines landing in L2 despite the NT hint (another explanation for the above difference), then you may get some hits. In most cases though, the NT hint ought to be resulting in misses and accessing main memory. This is actually something I had not considered. Do you think the report of cache misses might be a reporting missing L1 + L2? It could be. My test applications do get very high performance. Oddly, the app is faster with NTA on the AMD system, but pretty much unnoticeable on the Intel system. Thank you everybody for your thoughts!
  4. davidx9

    Cache Locking in C++

    I have dabbled in a bit of OS devving / processor development before, and of course Antheus you're right. But it just seems odd that even a Windows OS would reject data from the cache so haphazzardly. It also occured to me that perhaps the system monitoring tools are not telling the whole truth.
  5. davidx9

    Cache Locking in C++

    Quote:Original post by yahastu There aren't opcodes for controlling such low-level hardware details. You should run your program in a simulator to that gives you access to this kind of virtual cache information. Is that so? Surely this feature would be beneficial? Is there anyway I can hint to the memory manager that I want it to have a "higher priority". I know I can lock the working space in physical memory. It would suprise me if this was the case. Perhaps the inverse of the question is more important. Why would my data be removed from the cache if its used by the most active process? and its explicitly (hinted) stored there using the intrinsic __mm_fetch(...,HINT_NTA).
  6. Ignore the obvious problems that this may occur, but does anyone know a way to keep (lock) data in the processor cache, using C/C++? My research involves profiling scientific computations, and my application seems to be experiencing many cache misses for a 64KB matrix, even though I have 2MB of cache. I feel I could sacrifice the 64KB of cache and not risk system stability. I feel I'm quite a competent C++ programmer, so ASM, intrinsics or good old pseudo-code solutions would be appreciated. Interestingly the cache faults increase using an Intel Core2 Duo with Vista, over an AMD Opteron265 with XP. Google has not proven very helpful, so anyone got an idea? Regards, Davidx9
  7. davidx9

    plz correct the code

    Quote:Original post by jpetrie Quote: BTW, why should one not use system("pause") at the end of a console program like this? Because it's Flat Out Stupid. It is equivalent to things... I think when you're just starting out, and can barely manage to construct a class, portability and efficient batch execution is not high on the list of concerns; nor is the desire to customize your build environment. Of course jpetrie, you are absolutely technically correct, but quick fixes such as system("pause") could in theory accelerate the rate of learning new techniques, as long as you're careful later on.
  8. davidx9

    plz correct the code

    Sounds like homework to me. BTW, why should one not use system("pause") at the end of a console program like this?
  9. Has anyone else experienced this problem? I have a multi-dialog MFC app, that has a dialog which uses DirectX9 to generate a display. When running a debug build, everything works fine, focus changes are handled, other dialogs can be opened and closed, even other Directx9 dialogs can be created. However, when running a release build, if a dialog is created and shown, after the Directx9 dialog is displayed, the system crashes (with obviously limited debugging information). I should point out that the system is stable without the addition of Directx9 and works correctly with my software rasterizing routines. Also, the dialogs are created modeless. So my question is probably this - Does anyone know of any particular problems when integrating DirectX9 into MFC applications with the Release Build configuration?
  10. davidx9

    UK Game Selection

    Fantastic! Psychonauts is made by the much loved Grim Fandango team I believe. Yet another genre of game that seems to have disappeared, or evolved into the monotonous glut of CSI/Law&Order games. (They're not bad games, just not good!)
  11. davidx9

    UK Game Selection

    I'm from the UK, where there is, in my opinion, a terrible selection of games to choose from. They all appear to be the same. So I was wondering, what has caused this to happen? Last weekend I was recommended to and subsequently bought a game for my PS2 called "We Love Katamari". Now I never buy strange Japanese titles, but it is fantastic, and the most original game I have played in the last 5 years. Our friends in Japan may have some silly ideas, but at least they are trying something different. Why does the UK not have access to more of their games? I appreciate cultural differences are a factor, but surely not all of their releases are so full of Japanese peculiarities as to render them unplayable. My belief is the bargain bin culture that has risen in the UK, is to blame. Why would a publisher choose to release a game over here, if nobody is willing to 1) try something a little different, 2) pay release price for it? My post therfore is for two reasons: 1) Surely I can't be the only games player in the UK tired with crappy release schedules? What do you think are the reasons? What are your opinions? 2) To implore you to buy "We love Katamari" or other games of this ilk, at full release price, in an attempt to show overseas publishers that us UK dwellers are prepare to take on something a little different.
  12. davidx9

    Adding programming languages to your resume.

    This may sound a bit sad, but in my experience, just tell the truth. If you get a question about something you've said you know, and you don't, you've had it. However, you could be one of those genius types that can learn a language fully in three days...
  13. davidx9

    Degrees in 2D

    Its pretty much the same as in a none pixelated environment. Your objects can be represented as a vector with an origin. The origin is your objects location on the screen, and the other end of the vector is the direction the object is facing. origin = (ox,oy) pointing = (px, py) px = sin(angle) * distance from origin + ox py = cos(angle) * distance from origin + oy likewise you can move your objects around ox = ox + sin(angle) * moving_distance oy = oy + cos(angle) * moving_distance Because you work in rads, sin and cos are always less than 1, meaning your object will move the amount specified in moving_distance. Working wioth these vectors, its very simple to start including gravity and inertial physics, (infact these dont need trig functions)
  14. Buy this book, it got me going.... Advanced 3D Game programming with DirectX 9.0 Peter Walsh, Wordware Publishing Its concise, short and yet very descriptive. It covers everything.
  15. davidx9

    making a programming language

    Creating an entire programming language is an enormous task. You really have to be fluent with Object Oriented design and principles and types. You may find yourself having to do an advanced software engineering theory course first, or something similar such as languages and their implementation. The programming behind interpreters and compilers does not just parse commands, and execute something. I would suggest, that unless you are some genius individual (and you may well be), that a scripting language may be a "simpler" starting point, otherwise best of luck to you. David
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!