The trials and tribulations of an amateur game programmer. Please tell him where he is going wrong.
Tuesday, February 28, 2006
Viruses Plague British Businesses
(According to the BBC). Well there's an easy solution - haven't they heard of Linux? What are they waiting for?
Saturday, February 18, 2006
Calculating Line of Sight - Help Needed!
At the moment, Emergent Mercenary uses the following algorythm to work out of one unit can see another (i.e. are there any walls in the way):-
(Note - the map of the game is a simple 40x40 array, and each cell can be a wall or floor. Unit positions are stored as floating point numbers, so they can be anywhere, not just in the centre of a map square)
1) Work out a line from one unit to another
2) Move along the line, and at every interval, check whether the point is part of a wall or a map. If its a wall, the unit cannot see the target.
This does work well in general, but if two units are close together but round the corner from each other, it can sometimes return true when in fact there is a corner in the way. I could try increasing the interval, but this obviously increases the time it takes the algorythm to run. Does anyone know a better method?
Any help much appreciated.
(Note - the map of the game is a simple 40x40 array, and each cell can be a wall or floor. Unit positions are stored as floating point numbers, so they can be anywhere, not just in the centre of a map square)
1) Work out a line from one unit to another
2) Move along the line, and at every interval, check whether the point is part of a wall or a map. If its a wall, the unit cannot see the target.
This does work well in general, but if two units are close together but round the corner from each other, it can sometimes return true when in fact there is a corner in the way. I could try increasing the interval, but this obviously increases the time it takes the algorythm to run. Does anyone know a better method?
Any help much appreciated.
Removing Rogue Startup Programs From Windows
Until the world moves over to Linux, here's how to remove programs that keep starting up when you start Windows. Remove the following registry entries:-
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Launches a program automatically when a particular user logs in. This key is used when you always want to launch a program when a particular user is using a system.
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
Launches a program the next time the user logs in and removes its value entry from the registry. This key is typically used by installation programs.
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Launches a program automatically at system startup. This key is used when you always want to launch a program on a particular system.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
Launches a program the next time the system starts and removes its value entry from the registry. This key is typically used by installation programs.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
Launches a service (a standard NT service or a background process) automatically at startup. An example of a service is a Web server such as Microsoft Internet Information Server.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Launches a program automatically when a particular user logs in. This key is used when you always want to launch a program when a particular user is using a system.
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
Launches a program the next time the user logs in and removes its value entry from the registry. This key is typically used by installation programs.
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Launches a program automatically at system startup. This key is used when you always want to launch a program on a particular system.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
Launches a program the next time the system starts and removes its value entry from the registry. This key is typically used by installation programs.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
Launches a service (a standard NT service or a background process) automatically at startup. An example of a service is a Web server such as Microsoft Internet Information Server.
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
Subscribe to:
Posts (Atom)