Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] 2D Line of Sight

Author
Message
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 3rd Dec 2010 21:55 Edited at: 8th Apr 2014 02:53
Hi,

This code works well for tile based maps or rogue-like rpg text adventures. You simply pick one point of the map and then a second point of the map to see if there is anything blocking the view in between the two points.

This code has been ported from c code off the internet over to dbpro code. The link to the c code is:

http://roguebasin.roguelikedevelopment.org/index.php?title=Simple_Line_of_Sight
By: Steve Register [arns@arns.freeservers.com].txt

This code snippet should be pretty easier for you to use in your own projects. There are two REPEAT/UNTIL blocks in the code. You will need to change the UNTIL condition to meet your code's requirements for what can block the line of sight view.


noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 11th Dec 2010 18:46
cool do you think this could be used in a 2d space shooter? As a kind of raycast?
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Dec 2010 11:06
I made something similar but took a different approach using line intersections. Worst case scenario, you'd have 20 block checks for a 100 block grid.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 13th Dec 2010 15:52 Edited at: 13th Dec 2010 15:54
Hi noobnerd,
If you want a fast action type of game, I guess the accuracy of this kind of ray cast would depend on the size of the grid array that fits in your viewable play field area on the screen.

Would you want your space ships, stations, planets and etc. occupy only one space in the grid array or will they be big enough to occupy more then one space of the grid array? If they occupy more, then updating the grid array as they move around in space could get hairy unless you keep to a square or circle area from there current array position to check line of sight against.

Also, if you use this grid array for a whole section of space that the player can explore in, then you will need to worry about how much memory is being used for the grid array.

Anyways, It's probably possible to do and definitely interesting to think about, but I would do like Phaelax suggests specially with a non-tiled based game.

Does that help out any? Or was you thinking of doing something totally different?

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 14th Dec 2010 19:26
yeah it helped some, i dont fully understand how your code work in coding terms, my game can be found here:

http://forum.thegamecreators.com/?m=forum_view&t=178440&b=5

i was thinking on using it for future electronic warfare systems in asteroid fields, where you would have interuptions based on asteroids that are blocking line of sight and i can imagine dozens of other uses for it, another possible use i can imagine would be scanner/EW interference in nebulas based on thicker areas of cloud... etc. the uses are many if it takes a lot of memory though, it might be unpractical. atm. my game runs at the maximum 60fps i have limited it to no matter the amount of enemies (max i have tested is 99) so might not be a prob
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 14th Dec 2010 23:56
I took a look at your game, pretty cool! Those are some good ideas and I think can work, but mabie not perfectly I guess depending on the row, columns size of the array.

Is the area of space the player flys in have no boundaries? Or will there be boundaries where the player reaches one edge of the map and then appears on the opposite side of it?

If no boundaries, then you only need a grid array that spans the area that your mini-map covers. This should take less memory for the grid array. You then would have to update the grid array data only when objects are in the mini map area.

If you have boundaries, then you have to span the grid array across your whole playing area. Obviously this map of space will be bigger than your mini-map I would think and in this situation, you won't have to worry about objects moving in and out of the mini-map to then update the grid array. Every object will be tracked all the time in which will involve more calculations and more use of memory.

Quote: " i dont fully understand how your code work in coding terms"


In the LOS function above, I have array "array_pfmap" that defines the grid array of the playing field map. In my "Escape!" game that's linked above, array_pfmap holds data on where everything is(ie: Walls, key, door, the player, goblins, empty floor... ). For the torch light effect, I simply pass the players location on the map out towards the farthest distance that the torch light can reach in a for\next loop. So it would be called like LOS(PlayerX,PlayerY,TorchLightX,TorchLightY). If there is anything in between the two positions instead of just empty floor, then function returns a value of 1. OBJ_EMPTY_FLOOR is just a constant value that I defined for being an empty floor. So, If empty floor is all there is between the two points, then the function will return a 0.

The whole line:
"UNTIL array_pfmap(x,y).object<>OBJ_EMPTY_FLOOR"
will have to change to meet your game design standards. As for example you may have something like:
"UNTIL spacemap(x,y).object<>EMPTY_SPACE"
to detect if something is between your ship and the range of your scan.

Another thing for your game is that you will have to translate the X,Y positions of your objects to the correct positions in the grid array and then update the grid array what object(s) is there. And of coarse, when an object moves to a new position in the array, you will need to set the old position where the object was in the grid array to know that the object is no longer there.

Ok, I'll stop my ramblings there just in case I'm losing you... that's if you are still interested in this or not

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Devonps
14
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 15th Dec 2010 14:37
Hey Todd,

Just scanned your source code and it looks quite effective, I'm looking forward to downloading your full game and trying out the torchlight effect (can't at the moment as I'm at work!)

With regards your LOS code - I've employed a different technique, again based on code from Roguebasin, that uses the coordinates of a circle + other distance parameters to determine if a tile/object is visible.

If you're interested the source code is here. Which also has a link to my design blog.

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 15th Dec 2010 17:21
im just getting more and more intrested all the time
atm im doing another project so i cant do on my main project but when im ready with this, i will start focusing hard on the "2D Space" (creative name huh?) again.
the map effectively is infinite, you dont move, but your calculated movement moves everything else, and asteroids, stars loop to reversed position if they get too far away. enemies though can as far away as the real# variable allows ( 3.4E +/- 38 (7 digits) )
but in terms of the electronic warfare device etc, i think the minimap is fairly sufficient area of coverage.

i understand your code better now. but im a new guy here with coding, so i have never understood/needed to know what you do with things like "type" and what your "array_pfmap(x,y).object" means? it is some kind of variable? array? i learned arrays just recentlyish so this type comand is something i have never used before. (it is type that u have used?) and also i dont know the reason of global and local or why u have to define variables with the "as" command?

but i guess i have to learn them too sometime
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 15th Dec 2010 18:22 Edited at: 15th Dec 2010 18:22
Devonps, I'll definitely check it out.


noobnerd,

This is how I defined array_pfmap array in my game:


I defined array "array_pfmap" "AS" a user defined type(UDT).

Type "TYPE_MAP" allows me to hold a structure of data at every element of array "array_pfmap". The "as" keyword declares the array on what type of array it is. So for example, if I had used "AS INTEGER" after "DIM array_pfmap(MAP_WIDTH,MAP_HEIGHT)" then it would only be able to hold 1 integer variable at each element of the array.

The ".object" field after "array_pfmap(x,y)" is the type field name of an integer value from type "TYPE_MAP". Type "TYPE_MAP" also has the type field name of "lit" which is also defined "as" an integer.

If you crack open the "DarkBasic Professional Help" in your editor, from then main menu, select "PRINCIPLES" -> "Datatypes and variables
". That will be able to explain user data types and defining variables with the "AS" keyword better then me.

I personally like to try to declare globals and locals with every variable that is used in the program. It lets me know what variables I'm using and helps my code to be a bit more organized and readable. GLOBAL variables are defined before any functions at the beginning of your code. They are able to be used within any function. LOCAL variables are defined in functions and can only be used in that function it was defined in. With DBPro, you do not have to use the "global" and "local" keywords if you don't want to.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 16th Dec 2010 00:00
hmm sounds complex but i get the point of it, i currently have 1000 lines of code with 0 declared variables, no types and no functions. And yes it is somewhat messy. Maybe ill start using those in my next project to smoothen things up. But back to your 2D lod thingy, im just theorizing, but couldnt it be used to check what parts of a sprite i seen from somewhere, resulting in possibilities regarding 2D light effects? that would be fancy
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 16th Dec 2010 01:59 Edited at: 16th Dec 2010 03:24
Quote: " couldnt it be used to check what parts of a sprite i seen from somewhere, resulting in possibilities regarding 2D light effects?"


Possible but probably not practical. Off the top of my head, I can see mabie like a heightmap style mask that's virtually layered on top of the sprite. The mask would be a grid array for the sprite itself meaning each sprite would need it's own array. The width and height of the grid array can be a 1:1 ratio with the width and height of the sprite. The LOS function will have to know when it is checking inside the width and height area of the sprite to see what needs to be lit up. The heightmap style method would light up each pixel that is the max highest down the line of sight until a pixel is lower in height then the pixel before it.

Ofcoarse this method would be only used on sprites that are currently on screen. But for each sprite that is on screen that needs to be checked for lighting this way will take a bit of a hit in FPS performance( don't know how much, mabie not a lot). It will take a hit because of the FOR/NEXT loop to check from the staring point to all the end points of the LOS. The end points would be only the opposite sides of the sprite from the starting point.

I am a bit curious to see that in action. Frustrating part for me would be to make a heightmap for each sprite.

edit: mabie a normal map data could be used instead of a heightmap data for a sprite.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 16th Dec 2010 13:54
i thought of a simpler, less realistic version, if u paint say 12 yellow sprites to act as light layers, and sprite them on the sprite in question, with say 50 transparency and show only those that are seen from the lightsource? although this would mean 12 sprites per shadowed object it could be viable.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 16th Dec 2010 15:24
That would be a lot faster. I may not be thinking the same as you, but I'm seeing that only the outer edges ever getting lit up. Also the 12 yellow sprites would be like blocks of transparent color, wouldn't it? Can you actually "blend" a colored sprite with a source sprite so empty black areas of the sprite's image wont be effected by a yellow sprite?

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 16th Dec 2010 21:40 Edited at: 16th Dec 2010 21:40
no but i what i meant was that u first draw a sprite for the ship. then divide it in 12 parts, like pizza slices. then color them yellow and voila the yellow parts have black places where the ship has black places

like this, but divide it in 12 parts

Attachments

Login to view attachments
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 17th Dec 2010 01:32
ahhhh I see. This LOS code wouldn't work that way then. What would be more efficient would be to just get an angle between the ship position and the light position and then light up your "pizza slice" part from that result.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 17th Dec 2010 07:29
but whit the los thing (if it works like that) would allow shadows from asteroids and other objects, which would remove the pizzaslice in question?
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 17th Dec 2010 23:00 Edited at: 25th Jan 2011 21:39
I dont see how the pizza slice thing will work using the los function.

Let's give my beautiful artwork a gander...





I would use the LOS function for detecting things that are blocked. Using the picture above as an example, the asteroid would block a ship from a sun and make it "un-lit". Just have normal ambiance color for un-lit objects. Then if nothing is blocking a ship, then light it up. Here, you could use an algorithm to get the direction of the light from the ship's current 2d rotation. The ship's north or front would always be at 0 degree's. So, in the right side of the picture above, we have the sun at 0 degree's from the ship's current direction. If that ship above faced west or turned left 90 degree's, then the sun would be at 90 degree's of the ship's current direction. So if you know the direction of the sun is between 0-30 degree's of the ship's current direction, then you can light up that slice of the ship.

Basically, the major point of the picture above is to show you that there isn't a way to map "pizzaslices" of a ship to the X/Y grid array the los needs to work on.

The other thing I've been wanting to point out is the accuracy of the LOS function if used in an environment like this. When you map/translate the current real x/y position of the 2d objects in space to the grid array( or say multiple dimensional array like for example: spacemap(X,Y) ), you will get situations where you think visually an object should have some kind of light to it but wont. As in the picture above, the red ship center position is still mapped to the grid array 5,5, but following that red line I drew it may look funky as you may expect it to be lit.

I'll stop there to see if I made any sense ta ya

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY

Attachments

Login to view attachments
Devonps
14
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 17th Dec 2010 23:20
@Todd - do you use a distance relationship between your light source, an obstruction and your object under test?

For example if in the picture you have provided the "un-lit" ship is further away from the "blocking asteroid" than indicated would it be lit by the sun's rays bending around the asteroid?

Not trying to be pedantic - just trying to understand

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 17th Dec 2010 23:51
Hi Devonps

The LOS function here is designed for grid array/tiled maps like for rogue-like text games. So like the grid in the picture above, everything basically fits in each element cell. Let's say the un-lit ship above is the player. I would have the program call LOS(PlayerX,PlayerY,SunX,SunY), which would be LOS(6,6,1,1). The LOS function simply just takes one point of the array map to another and see if there is anything in between those points in a straight line as possible.

So in above picture if the un-lit ship was further away from the sun, but that asteroid is still in between the ship and the sun, it will still be "un-lit". The line the LOS function follows can't bend.

As with a torchlight effect that I do in the Escape! game, with two FOR/NEXT loops, from the player's position, it simply goes outwards 4 positions and calls the LOS function on the furthest points where the light could reach.

So, yes the distance is determined from the line between startx/starty and endx/endy. So you basically control the distance from specifying the start and end points.

Please ask away if ya need more help understanding my ramblings

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Devonps
14
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 18th Dec 2010 00:02
Ahh ok, when you were looking at Roguebasin did you see this article on FOV?

I ask as FOV is something that I'm very interested in for my roguelike

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Dec 2010 00:40 Edited at: 18th Dec 2010 00:45
Actaully I was randomly searching stuff through google and I just happened to end up at the page I have linked to in the code. So, I didn't actually see all the different articles and stuff Roguebasin has. Now that you got me looking, there's seems to be some interesting stuff there to read.

I assume what the LOS function I ported would be like a BASIC or DIAMOND behavior? Because it's point to point following a line based on the Bresenham's algorithm.

I see it talks about methods that have wider angles which is currently beyond me to code. I would just let the LOD function handle the FOV on it's own.

EDIT: I just edited my Escape! game's constant "torchlight" to 8
#CONSTANT TORCHLIGHT 8
and it does a pretty good job with the fov

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Devonps
14
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 18th Dec 2010 00:57 Edited at: 18th Dec 2010 00:58
I would agree with you in respect to your LOS method :o)

Roguebasin is a treasure troth of information for game design, I'm using it to dip into and out of as needed.

Ohh - excellent - any chance of a game update?

Keep up the good work :o)

edited - because the Old Speckled Hen is taking effect!

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Dec 2010 01:15 Edited at: 8th Apr 2014 02:54
[game source code no longer available]
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 18th Dec 2010 13:16
Todd

hmm i see, it might be impractical to do a grid so detailed as to accommodate all the pizza slices and call the Los function on them.
an other way might be ( correct me if im wrong ) to at the beginning of the game call the los function on the asteroids in such a fashion that it records the outest X and Y location of the asteroid on both sides, then another X and Y far away along the same line, then drawing an invisible line there, for line collision to check if the player is inside the asteroids "shadow cone", the asteroids never move so the shadow cone would only need to be generated once.

Attachments

Login to view attachments
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Dec 2010 17:30 Edited at: 18th Dec 2010 17:50
EDIT: Looking at your picture... I still don't see how one would "partially shadow" with this LOS function alone without creating some elaborate scheme sort of like what I was talking about in an above post about trying to create little array maps the size of each sprite. But, I think I was getting in over my head with that idea too.

The LOS function itself isn't able to record positions. But the way that it works it will make a "shadow cone" for you automatically. When checking how far you want to scan all around you, you will end up with "shadow cones" from objects blocking in the line of sight. So if you find that an array X/Y position is in a shadow of an object, then you can then specify on an array data element at that position is indeed shadowed/un-lit. That's how I do it with my Escape! game:



When a position in the array array_pfmap() needs to be set lit, I set the "lit" field of type TYPE_MAP to 1.

So, I guess if you want to pre-scan the entire area where the sun light can shine, you could as an example create a type field like "SunShadow" and set it to 1 when an X,Y position is shadowed by an object from the sun. When pre-scanning each position in the map array, the LOS function will create the "Shadow cone" automatically.

That would be a good idea to do that. Then when you map the ship's X/Y position to the grid array's X/Y position and that array element's "SunShadow" is set to 1, then draw the un-lit ship.

-----------------------------

On a side note:
I don't why, but in my Escape! game, I kept thinking I was only scanning from player position to the outer torch light range only. I think I was heavily in thought of doing just that at one point. If you ever tried drawing a 2d filled circle just by drawing a line from the center point outwards in all 360 directions, you'll noticed all pixels will not get filled up. That's why I check every position in the torch light area is to avoid skipping any positions the line of sight might skip.

Here's the part of code I use to scan every position in the torch light area:



I actually clear the map every turn to make everything "un-lit". Then I check the torchlight range area to see what array x/y positions I need to set as "lit". ( NOTE that I COULD save the torch light area, then just "un-lit" the torch light area the next turn and then after that light up the torch light area at the player's position. That would be faster then clearing the whole playing field.)

So with that in mind, the bigger the size of the array you make for the size of the map it covers, it may effect FPS performance more when you want to scan a larger area with the LOS function. It all depends on how you use it.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 18th Dec 2010 19:27
what i meant was to use the los function only once, to make the cones, then from there on use line collision on the pizzaslices to check if they have entered/exited the shadow cone. this way i could do a superprecise scan for the shadow cones, using a 10000x10000 map or something like that, because i would only do it once.then when yu get the shadowconeborders set up, line collision ( which doesnt use nearly as much memory i can imagĂ­ne ) would take it from there.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 18th Dec 2010 23:36
Sounds like you have a plan. I assume you do at least know how the LOS function works by now, right? Even if you don't end up using this, it was still an interesting topic to talk about.

Because this function wasn't really meant for a fast action game like yours, another idea to achieve your goals in realtime like that is to create some kind of "line intersects circle" kind of function. Then you could just test against objects on screen like a line from your player ship to an enemy ship( or a line from a ship to a light source ), and see if a circle the size of the 2d sprite object( ie: asteroid, other ship, etc..) intersects that line or not. Then you can apply your pizza slice lighting from that. Just an idea where you wouldn't have to worry about a sized array map and setting elements of it.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 19th Dec 2010 15:16
sounds nice! Yes it has been intresting and fun talking about this, and yup i have understood your LOS code now ^^
IBOL
Retired Moderator
19
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 25th Jan 2011 05:23
hi,
I will be using a derivation of your code in a game i'm working on,
so i just wanted to come one here and publicly say THANK YOU!
i have been trying to understand the concept of los/fov for a long time,
and this does it beautifully!

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 25th Jan 2011 21:36
Thanks IBOL for liking this port. At first, I only ported this code for the los effect. Before seeing this code actually working, I wasn't even thinking about any "fov" effect. The fov worked out on it's own and I was like saying coooool.

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Lost Dragon
13
Years of Service
User Offline
Joined: 22nd Aug 2010
Location:
Posted: 28th Jan 2011 07:10 Edited at: 28th Jan 2011 07:38
I just got this working in my tile engine (finally!). I'm doing it in a pretty rudimentary way at the moment - I'm just putting a black "darkness" tile in any x,y location the LOS says can't be seen. If it can be seen then I draw the tile that should be there instead. I only do it for tiles that are on screen (instead of the whole map) so it works pretty well.

Now that I've got this going, I can tweak it with tile types that are always lit or never lit and then handle LOS for objects on my layers.

Anyway, that is sort of getting away from the thread.

Thanks for porting this over!!
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 29th Jan 2011 03:38
Great to hear, Lost Dragon!

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 2nd Mar 2011 16:49 Edited at: 3rd Mar 2011 04:33
The original posted code is not working as expected for me.

For starters, the compiler tells me that SGN is a reserved word and can't be used as a function name. That's fine, I changed it to SiGN() and the error went away.

But I'm getting erratic results for LOS detection. I'm checking a simple array of ones and zeroes. Sometimes the LOS is only detected at a short distance, even though there is a straight "down the hallway" to the target.

I'll fudge up an example and post it here in a bit.

EDIT: Well, the example I coded works just fine. I'll have to dig into my code and find out what I'm doing wrong. I'm sure I've missed something somewhere.

MORE EDIT: HA! It was my code, I wasn't properly filling in the 1's and 0's on my check array.

Frank C
13
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 3rd Mar 2011 13:15
If you are using IanM's Matrix utilities you need to remove the SGN function from the code and instead use his ABS value function call.
Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 5th Mar 2011 02:04
Ah sorry I didn't get to ya sooner,Rich. But glad to see that you found out the problem and that it's work'n for ya now

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 25th Mar 2011 16:44
@Todd - Just wanted to say THANKS! This is coming in very handy, and your code/comments make it very easy to use!

Login to post a reply

Server time is: 2024-03-28 21:10:39
Your offset time is: 2024-03-28 21:10:39