Is the polygon a rectangle? Aligned with the X and Y axes? Because
that's EASY! If the polygon isn't such a rectangle, make it into one!
Everybody likes rectangles. It's been proven by Archimedes Plutonium.
Otherwise, you can use this simple algorithm:
1. Draw the polygon on the screen in "red"
2. Draw the point on the screen in "green"
3. Pop up a WinDialogBox and ask the user:
"Is the point inside the polygon? (YES/NO)
4. Bask in your cleverness!
Also, READ THE FUGGEN FAQ!!
http://www.faqs.org/faqs/graphics/algorithms-faq/
Subject 2.03: How do I find if a point lies within a polygon?
The definitive reference is "Point in Polygon Strategies" by
Eric Haines [Gems IV] pp. 24-46.
The code in the Sedgewick book Algorithms (2nd Edition, p.354) fails
under certain circumstances. See
http://condor.informatik.Uni-Oldenburg.DE/~stueker/graphic/index.html
for a discussion.
The essence of the ray-crossing method is as follows.
Think of standing inside a field with a fence representing the polygon.
Then walk north. If you have to jump the fence you know you are now
outside the poly. If you have to cross again you know you are now
inside again; i.e., if you were inside the field to start with, the total
number of fence jumps you would make will be odd, whereas if you were
ouside the jumps will be even.
The code below is from Wm. Randolph Franklin <w...@ecse.rpi.edu>
(see URL below) with some minor modifications for speed. It returns
1 for strictly interior points, 0 for strictly exterior, and 0 or 1
for points on the boundary. The boundary behavior is complex but
determined; in particular, for a partition of a region into polygons,
each point is "in" exactly one polygon.
(See p.243 of [O'Rourke (C)] for a discussion of boundary behavior.)
int pnpoly(int npol, float *xp, float *yp, float x, float y)
{
int i, j, c = 0;
for (i = 0, j = npol-1; i < npol; j = i++) {
if ((((yp[i]<=y) && (y<yp[j])) ||
((yp[j]<=y) && (y<yp[i]))) &&
(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
c = !c;
}
return c;
}
The code may be further accelerated, at some loss in clarity, by
avoiding the central computation when the inequality can be deduced,
and by replacing the division by a multiplication for those processors
with slow divides. For code that distinguishes strictly interior
points from those on the boundary, see [O'Rourke (C)] pp. 239-245.
References:
Franklin's code: http://www.ecse.rpi.edu/Homepages/wrf/geom/pnpoly.html
[Gems IV] pp. 24-46
[O'Rourke (C)] Sec. 7.4.
[Glassner:RayTracing]
-------------------------------------------------------------------
I like my algorithm better.
cheers
Beable van Polasm
--
A wise lobster knows the power of its own claws -- Doctor Yes
IQC 78189333
http://members.nbci.com/_______/index.html
RIGHT!
cheers
Beable van Polasm
--
I can't help that my head is made of dirt.
I couldn't afford a meat one! --Terri Willis
IQC 78189333 http://members.nbci.com/_______/index.html
Hey that's a good idea. I never even thought of getting rid
of those pesky negative random numbers.
> se...@plethora.net (Peter Seebach) writes:
>>
>> In article <9h3un6$2ei$1...@bigboote.WPI.EDU>,
>> Joshua E Millard <pu...@WPI.EDU> wrote:
>> >void main(void)
>>
>> WRONG!
>
> RIGHT!
ihbt.c: In function `main':
ihbt.c:3: warning: return type of `main' is not `int'
WAAH!
--
Simon Clark
EXACTLY what I said!
> WAAH!
WAAAAASP!
cheers
Beable van Polasm
--
Everyone's entitled to their opinion, even idiots -- Paul Hogan
IQC 78189333 http://members.nbci.com/_______/index.html
> Simon Clark <cla...@my-deja.com> writes:
>>
>> Beable van Polasm <bea...@my-deja.com> wrote:
>>
>> > se...@plethora.net (Peter Seebach) writes:
>> >>
>> >> In article <9h3un6$2ei$1...@bigboote.WPI.EDU>,
>> >> Joshua E Millard <pu...@WPI.EDU> wrote:
>> >> >void main(void)
>> >>
>> >> WRONG!
>> >
>> > RIGHT!
>>
>> ihbt.c: In function `main':
>> ihbt.c:3: warning: return type of `main' is not `int'
>
> EXACTLY what I said!
http://www.htsoft.com/software/cpm/index.html
This compiler DOES like void main(void) but the GNU C compiler
DOESN'T--which means you are BOTH wrong and *I* am RIGHT! I WIN!
YAAAAAAAAAAAAAAAAAAAAY! CP/M R()()LZ!!!
>> WAAH!
>
> WAAAAASP!
PENGUIN!
--
Simon Clark
If they're -really- random, they could be A NY THING!
Dave "how'd this Zapf Dingbat get in my peanut butter?" DeLaney
--
\/David DeLaney posting from d...@vic.com "It's not the pot that grows the flower
It's not the clock that slows the hour The definition's plain for anyone to see
Love is all it takes to make a family" - R&P. VISUALIZE HAPPYNET VRbeable<BLINK>
http://panacea.phys.utk.edu/~dbd/ - net.legends FAQ/ I WUV you in all CAPS! --K.
This is where I mention how I find it disturbing that running an
Allegro application clamps the CPU at 100%. If they could fix
that, I'd probably use it. If I wanted to run software that kept
the CPU usage maximised, I could install Windows or something.
Something like SIMON CLARK'S ROOT KIT! HAW HAW!
cheers
Beable van Polasm
--
If you write code that needs comments at the end of a line,
your code is crap. -- Linus Torvalds
IQC 78189333 http://members.nbci.com/_______/index.html
> This is where I mention how I find it disturbing that running an
> Allegro application clamps the CPU at 100%. If they could fix
> that, I'd probably use it. If I wanted to run software that kept
> the CPU usage maximised, I could install Windows or something.
> Something like SIMON CLARK'S ROOT KIT! HAW HAW!
Well, that's easy: Most games don't bother with fancy things like sleeping
or waiting for IO, which is how other programs get away with not using the
CPU all the time. A game will just grab all the cycles it can, and that's
not just Allegro games, either.
--
Dag Agren <> d...@c3.cx <> http://www.abo.fi/~dagren/ <> Legalize oregano
"REPLACE GLOBAL CAPITALISM WITH SOMETHING NICE!"
BUT! SDL doesn't do that. An Allegro program uses 100% CPU even when
it's doing nothing. An SDL program can be drawing all over the screen
and use less than 10% CPU. You'll probably think "so what?", so I
better say that I don't like programs that use 100% CPU for no reason,
because it makes the CPU fan turn on, which is noisy.
> BUT! SDL doesn't do that. An Allegro program uses 100% CPU even when
> it's doing nothing. An SDL program can be drawing all over the screen
> and use less than 10% CPU. You'll probably think "so what?", so I
> better say that I don't like programs that use 100% CPU for no reason,
> because it makes the CPU fan turn on, which is noisy.
Well, that means that the SDL program is doing some waiting. WHICH MEANS
IT'S NOT USING ALL THE CPU POWER AVAILABLE! SO IT'S SLOWER THAN IT SHOULD
BE! AND THAT SUCKS!
It's probably using OpenGL and waiting for the 3d hardware to do it's job,
I guess. But it should be doing it's own calculations in the meantime! Not
optimized enough!
>Well, that means that the SDL program is doing some waiting. WHICH MEANS
>IT'S NOT USING ALL THE CPU POWER AVAILABLE! SO IT'S SLOWER THAN IT
>SHOULD BE! AND THAT SUCKS!
I noticed thge message loop in SDL has a little lag in it when dragging
1024x768 bitmaps around the screen like a mouse cursor.
IYKWIM!!!111!1!!
--
/\ _____________
(__\ |Shiro Akaishi| There are two extra Z's in my e-mail address.
) \. ------------- You need to remove them for my e-mail to be correct
/. But *which two*?
You MUST be joking. I thot you wuz a R33L PR0GRAM3R-D00D!
What it means is they are rather foolishly not doing a snooze(),
Sleep(), or whatever in each thread's main loop to give up the CPU every
now and then. It's eating up 100 percent of the CPU time polling the
keyboard over and over again or something stupid like that. I bet it
makes even the game itself run poorly as the OS finds itself starved for
time to move the mouse cursor around, handle disk requests, etc.
I mean, HELLO?! I think we've pretty well established that
multi-tasking is a GOOD THING by now!! CPU-HOGS are NOT, however.
> You MUST be joking. I thot you wuz a R33L PR0GRAM3R-D00D!
> What it means is they are rather foolishly not doing a snooze(),
> Sleep(), or whatever in each thread's main loop to give up the CPU every
> now and then. It's eating up 100 percent of the CPU time polling the
> keyboard over and over again or something stupid like that. I bet it
> makes even the game itself run poorly as the OS finds itself starved for
> time to move the mouse cursor around, handle disk requests, etc.
> I mean, HELLO?! I think we've pretty well established that
> multi-tasking is a GOOD THING by now!! CPU-HOGS are NOT, however.
You are right, IF we were talking about normal application, or your
average system-friendly puzzle game. A real game, however, does not EVER
sit in an input loop. It will check for keyboard and other input ONCE, and
then IMMIDIATELY render a new frame. Rendering frames as fast as possible
is the sole purpose of the game engine. If you sleep, you can't render
frames. If you sit in an input loop, you can't render frames. If you wait
for IO, you can't render frames.
A real OS will of course have REAL multitasking, so other apps will get
their CPU time if they really need it. But who are you kidding - it's
not like you're likely to have anything else running while you're
playing. Also, the OS should use interrupts for mouse and disk IO, so even
if you sit in a 100% CPU time loop, they will work smoothly.
Suppose the game takes 1/200th of a frame to update the screen, and the
refresh rate is 85Hz? The CPU is likely burning lean calories drawing
frames that won't even be seen.
>A real OS will of course have REAL multitasking, so other apps will get
>their CPU time if they really need it. But who are you kidding - it's
>not like you're likely to have anything else running while you're
>playing. Also, the OS should use interrupts for mouse and disk IO, so even
>if you sit in a 100% CPU time loop, they will work smoothly.
Well, the OS should do a lot of things.
--
Nick Bensema <ni...@io.com> ICQ#2135445
==== ======= ============== http://www.io.com/~nickb/
> Suppose the game takes 1/200th of a frame to update the screen, and the
> refresh rate is 85Hz? The CPU is likely burning lean calories drawing
> frames that won't even be seen.
Well, that's true. However, many games would still benefit from the added
precision given by those extra frames. Also, syncing with the refresh rate
of a graphics card is pretty difficult these days, since it seems both
Microsoft and card manufacturers don't see this as a useful thing, and
cards generally don't generate vsync interrupts or anything similar.
I agree, but
You're both right. While it would be great to find
some way to optimize CPU utilization, I'd be
interested in knowing how you could efficiently
camp on input. IOW, you're not just moving through
a 3d world (in which one could argue the case that
no input means no alteration in the perspective view
so no rendering is necessary), but you're also rendering
animation sequences like explosions, fog, flickering
illumination caused by torches and the like - anything
less that 20 frames per second puts persistence in
jeopardy. And you never really know when the user
will react so it seems the state machine must be
executed continuously or things will get too jumpy.
Jim Smith
Threads, baybee! One thread does the drawing at the chosen
framerate, and another thread listens for user input.
cheers
Beable van Polasm
--
I'm wearing coat hangers on my feet. -- Chris Costello
IQC 78189333
http://members.nbci.com/_______/index.html
>
> Threads, baybee! One thread does the drawing at the chosen
> framerate, and another thread listens for user input.
and one thread that, like, in the darkness binds them and stuff.
--
CRGRE
``Reality of course would be something else entirly and these
Conjuctures of Quake `Applauses', `Seasons', `Jiggles', & `Rounds'.
are mostly theoritical and may not in fact be found in the Library.''
-Manley Hubbell
> Threads, baybee! One thread does the drawing at the chosen
> framerate, and another thread listens for user input.
God, Beable. That way lies MADNESS!
I'M PLAYERKILLFILING YOUR CHARACTER _RIGHT NOW_!
Dave "magic words of poof poof piffles" DeLaney
>Beable van Polasm <bea...@my-deja.com> wrote:
>> Threads, baybee! One thread does the drawing at the chosen
>> framerate, and another thread listens for user input.
>God, Beable. That way lies MADNESS!
Wassa matter with threads? I love 'em. I have a applet that not only has Be-
style UI thread and background thread pool, but can also make use of a thread
pool back on the server. Awesome Powah!
--
Patrick Phelan
w____\\W//___w Te Hupenui
"Ronald Wilson Reagan" is "Insane Anglo Warlord"
http://copeland.choicelogic.com/~phelan/
>>Beable van Polasm <bea...@my-deja.com> wrote:
>>> Threads, baybee! One thread does the drawing at the chosen
>>> framerate, and another thread listens for user input.
>>God, Beable. That way lies MADNESS!
> Wassa matter with threads? I love 'em. I have a applet that not only has Be-
> style UI thread and background thread pool, but can also make use of a thread
> pool back on the server. Awesome Powah!
Oh, threads are nice enough, but for game coding it'd be a nightmare to
get everything synced up, I figure.
>Oh, threads are nice enough, but for game coding it'd be a nightmare to
>get everything synced up, I figure.
Not that I'd know, but:
Thread 1 listens to the keyboard, changes the delta values.
Thread 2 looks for collisions, adds deltas once per turn.
Thread 3 renders to the screen.
I don't see a particular need to sync up anything, especially if you are
already rendering much faster than the video frame rate.
I wrote 2 games once. 1 was an Asteriods clone, the other had impressive AI
for a 2D maze game. The enemies formed hierachical groups based on line of
sight communications. Before Half-Life, I had groups that could surround you
and then bomb you from a safe distance until they ran out of bombs, then
charge.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Unimportant Lust
http://copeland.choicelogic.com/~phelan/
>>Oh, threads are nice enough, but for game coding it'd be a nightmare to
>>get everything synced up, I figure.
> Not that I'd know, but:
> Thread 1 listens to the keyboard, changes the delta values.
> Thread 2 looks for collisions, adds deltas once per turn.
> Thread 3 renders to the screen.
Say you want to sort objects in increasing order of Y-coordinate, which
you might to make collisiondetection easier in a 2D game. You don't want
to do that while some other threads is walking through your object
list. And so on.
Instead you could just sequentially:
- Poll the keyboard once, doing whatever you should with the results
- Move objects, check for collisions
- Render screen
Lather, rinse, repeat. There's no need to get fancy.
> I wrote 2 games once. 1 was an Asteriods clone, the other had impressive AI
> for a 2D maze game. The enemies formed hierachical groups based on line of
> sight communications. Before Half-Life, I had groups that could surround you
> and then bomb you from a safe distance until they ran out of bombs, then
> charge.
Pretty cool. I was thinking of doing some sort of military hiearchy for
enemies in Levity, so that lower-ranking units take orders from
higher-ranking ones, if they can communicate. So if you kill the leaders,
the rest get confused.
ABORT! CANCEL! TERMINATE! Patrick is trying to overload us all with
infinite unmatched brackets! ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]NO
CARRIER
Thread 30 is for talk about al-ens and J-hn W-nston.
>I don't see a particular need to sync up anything, especially if you
>are already rendering much faster than the video frame rate.
Why waste CPU time rendering frames that will never be seen? Optimize!
>I wrote 2 games once. 1 was an Asteriods clone, the other had
>impressive AI for a 2D maze game.
TEH GHOSTS WOULD CHASE YUO AROUND, EXCEPT WHEN YUO ATE A POW-AH PELLET,
THEN YOU WOULD CHASE THEY!!!!!1one
>The enemies formed hierachical
>groups based on line of sight communications. Before Half-Life, I
>had groups that could surround you and then bomb you from a safe
>distance until they ran out of bombs, then charge.
So they weren't worried about hitting each other in the crossfire? YOU
FOOL!
-Poot
> Before Half-Life, I had groups that could surround you
> and then bomb you from a safe distance until they ran out of bombs, then
> charge.
Tweak it into some kind of fuzzy love triangle and post it in the FAQ.
>fan...@geocities.com (Fantod) wrote:
>>I don't see a particular need to sync up anything, especially if you
>>are already rendering much faster than the video frame rate.
>
>Why waste CPU time rendering frames that will never be seen? Optimize!
That is what the kids are doing these days, even if it is wasteful. Back in
my day, a game used so much CPU that you didn't need a clock at all, you had
just enough instructions that a second of game time required exactly a second
of CPU time.
>>The enemies formed hierachical
>>groups based on line of sight communications. Before Half-Life, I
>>had groups that could surround you and then bomb you from a safe
>>distance until they ran out of bombs, then charge.
>
>So they weren't worried about hitting each other in the crossfire? YOU
>FOOL!
They did worry about hitting each other in a crossfire, that is why they
bombed from a safe distance. The bomber could order a non-bomber to get out
of the way.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Go Bellsprout! Go Bellsprout! When this sprout battles, you'd better watch
out!
http://copeland.choicelogic.com/~phelan/
>Fantod schreef in berichtnieuws...
>
>> Before Half-Life, I had groups that could surround you
>> and then bomb you from a safe distance until they ran out of bombs, then
>> charge.
>
>Tweak it into some kind of fuzzy love triangle and post it in the FAQ.
You mean that pink triangle? I don't know if I'd call that fuzzy.
Also, it was in the NAQ, until you asked.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Owl Stretching Time
http://copeland.choicelogic.com/~phelan/
>Fantod <fan...@geocities.com> wrote:
>> [Dag [gren]:
>>>Oh, threads are nice enough, but for game coding it'd be a nightmare to
>>>get everything synced up, I figure.
>> Not that I'd know, but:
>> Thread 1 listens to the keyboard, changes the delta values.
>> Thread 2 looks for collisions, adds deltas once per turn.
>> Thread 3 renders to the screen.
>Say you want to sort objects in increasing order of Y-coordinate, which
>you might to make collisiondetection easier in a 2D game. You don't want
>to do that while some other threads is walking through your object
>list. And so on.
Thread priority. 1 does almost nothing, and is highest, while 3 does large
amount of processing, and is lowest. As 1 blocks almost immediately on the
keyboard, 2 is free to do its processing. Then it sleeps for the remainder of
the turn while 3 runs.
Also, Java has a nifty synchronize feature, so I don't know how hard this is
in other languages.
>Instead you could just sequentially:
>- Poll the keyboard once, doing whatever you should with the results
>- Move objects, check for collisions
>- Render screen
>Lather, rinse, repeat. There's no need to get fancy.
I never said there was. But what if the CPU is slow, and the keyboard buffer
fills up while the rendering is going on? The threads allow you define that
keyboard reading is more important than rendering.
Also, what started all this is that scheme will end up using 100% of the CPU,
which is bad if you are also attempting to run other things.
IANA game designer, so you probably should not be listening to me, anyway.
>> I wrote 2 games once. 1 was an Asteriods clone, the other had impressive
>> AI for a 2D maze game. The enemies formed hierachical groups based on
>> line of sight communications. Before Half-Life, I had groups that could
>> surround you and then bomb you from a safe distance until they ran out
>> of bombs, then charge.
>Pretty cool. I was thinking of doing some sort of military hiearchy for
>enemies in Levity, so that lower-ranking units take orders from
>higher-ranking ones, if they can communicate. So if you kill the leaders,
>the rest get confused.
I had "brains". When a unit was spotted by someone whose brain outranked his
own, his brain was replaced. The new brain would then calculate the group
goal, and order its units around. When the connection was broken, the
original brain was restored.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Ah, my friend the squeegee. I love you. -Crow
http://copeland.choicelogic.com/~phelan/
>>- Poll the keyboard once, doing whatever you should with the results
>>- Move objects, check for collisions
>>- Render screen
>>Lather, rinse, repeat. There's no need to get fancy.
> I never said there was. But what if the CPU is slow, and the keyboard buffer
> fills up while the rendering is going on? The threads allow you define that
> keyboard reading is more important than rendering.
Well, keyboard handlink is usually done through interrupts, so that's not
normally a problem. But you could have a really simple thread that just
picks off the keyboard events and stores the results in some array for the
main thread to use.
> Also, what started all this is that scheme will end up using 100% of the CPU,
> which is bad if you are also attempting to run other things.
You can always give the single game process lower priority, so that it'll
eat all CPU cycles that noone else wants.
>>> I wrote 2 games once. 1 was an Asteriods clone, the other had impressive
>>> AI for a 2D maze game. The enemies formed hierachical groups based on
>>> line of sight communications. Before Half-Life, I had groups that could
>>> surround you and then bomb you from a safe distance until they ran out
>>> of bombs, then charge.
>>Pretty cool. I was thinking of doing some sort of military hiearchy for
>>enemies in Levity, so that lower-ranking units take orders from
>>higher-ranking ones, if they can communicate. So if you kill the leaders,
>>the rest get confused.
> I had "brains". When a unit was spotted by someone whose brain outranked his
> own, his brain was replaced. The new brain would then calculate the group
> goal, and order its units around. When the connection was broken, the
> original brain was restored.
Hmm, interesting. You do realize that by telling me this, I'll probably
rip off the idea, right?
I think you mean:
"Vell, keyboard handlink is usually done vit interrupts, VE HAF VAYS
OFF MAKINK YOU TALK!"
> > Also, what started all this is that scheme will end up using 100%
> > of the CPU, which is bad if you are also attempting to run other
> > things.
>
> You can always give the single game process lower priority, so that it'll
> eat all CPU cycles that noone else wants.
OOOOOOOOOOOOOOOOOOOO KAAAAAAAAAAAAAAAAAAAAAY. What this comes down to,
DAG, is that a process should use WHAT IT NEEDS, not ALL IT CAN GET!!!
I am advocating a COMMUNIST OPERATING SYSTEM, where each process GETS
WHAT IT NEEDS, and GIVES WHAT IT CAN. YOU, you filthy capitalist
running-dog, are trying to FORCE people to use a disgusting
EXPLOITATIVE GREEDY OPERATING SYSTEM, where one process (THE MAN)
gobbles up all the resources it can get. You are trying to sugar coat
it by saying "Oh it's only taking stuff that nobody else wants", BUT
THAT'S NOT FOOLING ME!! NOT FOR ONE MINUTE!
If you ask Allegro to draw NOTHING, it uses 100% CPU. If you ask it to
draw something, it still uses 100% CPU. This SUCKS. There is no point
in Allegro drawing more "frames per second" than the video hardware
can display. What if we had 100GHz CPUs? Would you still think it was
OK for Allegro to use 100% CPU to draw 1000000 frames per second if
the video card and monitor could only display 180 frames per second?
It's all very well for a game to use as much CPU as it needs, for AI
and pathfinding and stuff. But it is NOT OK for Allegro to waste CPU
cycles doing nothing. You are WORSE THAN HITLER if you think that it
is ok to waste CPU cycles.
> > I had "brains". When a unit was spotted by someone whose brain
> > outranked his own, his brain was replaced. The new brain would
> > then calculate the group goal, and order its units around. When
> > the connection was broken, the original brain was restored.
Mmmmmmmmmm BRANEZ!!!
> Hmm, interesting. You do realize that by telling me this, I'll probably
> rip off the idea, right?
ZOMBIE! DAG IS THE ZOMBIE HITLER!! HIDE YOUR BRANEZ!!
Wasting hundreds if not THOUSANDS of
CPU cycles all over the world RIGHT NOW,
Beable van Polasm
--
WHAT WOULD WILLIAM SHATNER DO? IQC 78189333
I was really surprised to be asked here tonight to honour Bob Hope.
Surprised isn't the right word... annoyed -- Ronald Reagan
http://members.nbci.com/_______/index.html
> I think you mean:
> "Vell, keyboard handlink is usually done vit interrupts, VE HAF VAYS
> OFF MAKINK YOU TALK!"
Da. Is vat I mean.
>> You can always give the single game process lower priority, so that it'll
>> eat all CPU cycles that noone else wants.
> OOOOOOOOOOOOOOOOOOOO KAAAAAAAAAAAAAAAAAAAAAY. What this comes down to,
> DAG, is that a process should use WHAT IT NEEDS, not ALL IT CAN GET!!!
> I am advocating a COMMUNIST OPERATING SYSTEM, where each process GETS
> WHAT IT NEEDS, and GIVES WHAT IT CAN. YOU, you filthy capitalist
> running-dog, are trying to FORCE people to use a disgusting
> EXPLOITATIVE GREEDY OPERATING SYSTEM, where one process (THE MAN)
> gobbles up all the resources it can get. You are trying to sugar coat
> it by saying "Oh it's only taking stuff that nobody else wants", BUT
> THAT'S NOT FOOLING ME!! NOT FOR ONE MINUTE!
> If you ask Allegro to draw NOTHING, it uses 100% CPU. If you ask it to
> draw something, it still uses 100% CPU. This SUCKS. There is no point
> in Allegro drawing more "frames per second" than the video hardware
> can display. What if we had 100GHz CPUs? Would you still think it was
> OK for Allegro to use 100% CPU to draw 1000000 frames per second if
> the video card and monitor could only display 180 frames per second?
Well if you're not going to be DRAWING ANYTHING, you shouldn't use Allegro
IN THE FIRST PLACE, SHOULD YOU? And if you're drawing more frames than the
monitor can display, then YOU'RE NOT DRAWING ENOUGH STUFF ON THEM!
And is it that you think you're doing while playing a game, anyway, that
needs so many CPU cycles for itself? RAYTRACING? ENCODING MPEGS? STOP
PLAYING THEN, YOU IDIOT!
>Fantod <fan...@geocities.com> wrote:
>> [Dag Right-square-bracket-gren]:
>>>- Poll the keyboard once, doing whatever you should with the results
>>>- Move objects, check for collisions
>>>- Render screen
>
>>>Lather, rinse, repeat. There's no need to get fancy.
>
>> I never said there was. But what if the CPU is slow, and the keyboard
>> buffer fills up while the rendering is going on? The threads allow you
>> define that keyboard reading is more important than rendering.
>
>Well, keyboard handlink is usually done through interrupts, so that's not
>normally a problem.
Java doesn't really have interrupts. Also, I should point out again that I
don't know squat about games. I write code designed to run across networks of
servers.
> But you could have a really simple thread that just
>picks off the keyboard events and stores the results in some array for the
>main thread to use.
That is nearly what I was suggesting.
>> Also, what started all this is that scheme will end up using 100% of the
>> CPU, which is bad if you are also attempting to run other things.
>
>You can always give the single game process lower priority, so that it'll
>eat all CPU cycles that noone else wants.
Too many things cause NT to hang to make that workable. Of course, I should
get a Mac.
>>>> I wrote 2 games once. 1 was an Asteriods clone, the other had
>>>> impressive AI for a 2D maze game. The enemies formed hierachical
>>>> groups based on line of sight communications. Before Half-Life, I had
>>>> groups that could surround you and then bomb you from a safe distance
>>>> until they ran out of bombs, then charge.
>
>>>Pretty cool. I was thinking of doing some sort of military hiearchy for
>>>enemies in Levity, so that lower-ranking units take orders from
>>>higher-ranking ones, if they can communicate. So if you kill the
>>>leaders, the rest get confused.
>
>> I had "brains". When a unit was spotted by someone whose brain outranked
>> his own, his brain was replaced. The new brain would then calculate the
>> group goal, and order its units around. When the connection was broken,
>> the original brain was restored.
>
>Hmm, interesting. You do realize that by telling me this, I'll probably
>rip off the idea, right?
Consider it an open source idea. I just sat on it for years, so if it
actually accomplishes something, I'll be overjoyed.
I had thought that with people trumpeting Half Life's more intelligent
enemies, that everybody would be doing that sort of a thing, and nobody would
want to give me money for the idea. By the time I noticed that most games
seem to have gotten stupider, I had lost the revolutionary fervor. I had
never made it further than getting an industry contact, anyway.
Even the aliens in Marathon could talk to each other, and that is 8? years
old. I still see reviews of games that note that guards will walk over the
corpse of a fellow guard and do nothing, but attack from miles away if you
step on the wrong pixel.
--
Patrick Phelan
w____\\W//___w Te Hupenui
A Chance to Cut is a Chance to Cure
http://copeland.choicelogic.com/~phelan/
>And is it that you think you're doing while playing a game, anyway, that
>needs so many CPU cycles for itself? RAYTRACING? ENCODING MPEGS? STOP
>PLAYING THEN, YOU IDIOT!
The reason threading is a hot topic for me is that for the BeOS, you really
can encode MPEGs, ray trace, play video and play a game all at the same time.
And as none of my software will run on the BeOS, I try and bring the BeOS to
my software. By threading (Runnable, actually) the living daylights out of
everything, I can keep my UI fresh ond full of life, and even offload work
onto other machines with out making the idi^H^H^Hclients get a super
expensive OS that supports clustering, like Linux.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Oh, God, you're so beeg -- Evil Gellar
http://copeland.choicelogic.com/~phelan/
Yes.
> And as none of my software will run on the BeOS, I try and bring the
> BeOS to my software.
A noble goal!
>Fantod trollerated me:
Not a trollerization at all! If I could run Java on it, I'd be an obnoxious
BeOS fan. When I first installed it, I was amazed at the performance of the
machine that is pokey and stuttering under NT. I can't even change color
depth without risking a crash, and BeOS can do a different frequency and
color depth for each virtual desktop. The same hardware!!!1!
Oh, well.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Pride at Dusk
http://copeland.choicelogic.com/~phelan/
If anybody uses those magic four letters together like that, to me it's
a troll, because I won't be able to help responding, and that's as good
a definition of "troll" as any, isn't it?
> If I could run Java on it, I'd be an obnoxious BeOS fan.
You could take up the stalled BeKaffe port ...
> When I first installed it, I was amazed at the performance
> of the machine that is pokey and stuttering under NT. I can't even
> change color depth without risking a crash, and BeOS can do a
> different frequency and color depth for each virtual desktop. The
> same hardware!!!1!
It's like writing a story. It's not just what you put in, it's also
what you leave out.
>> If I could run Java on it, I'd be an obnoxious B**S fan.
>You could take up the stalled BeKaffe port ...
A chicken and egg problem: I can't run the things I like to have around while
writing BeKaffe until I write BeKaffe. All the Javadoc I have is served out
of a zip file by a Java servlet. My mail is encrypted by a Java app. A Java
servlet fetches the daily comics.
Also, I am in a comfortable rut. I have a nice text editor, a reasonably nice
file browser, and so on. I have learned not to do rather a lot of things that
will crash the machine.
On the plus side, I am slowly converting the servers to Linux, so if I get
used to doing cmdline development on Unix again, I can more easily use a
different front end. Originally, I wrote programs for Suns on a Mac.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Happy Idiot Talk
http://copeland.choicelogic.com/~phelan/
I think most peopel here are gamers, aren't they? Motivissimo. Yo
Quiero Riverdance
Well then by rights I should be the writer of the
highest quality fiction this side of Thomas Pynchon
before he was wacked with the crazy stick. I've left
out more from my stories than anybody. I've omitted
character descriptions, excised major plot points,
and removed every noun from the final chapter. Then
I removed the final chapter.
Heck, I didn't even write seventeen of my last
eighteen story ideas to better maintain their purity
and depth of thought. I think you'll find the
non-existant reviews of my uncollected works support
my decision on this matter.
On a personal note, I would like to thank you, Johnny
Favorite, for the wonderful fresh, warm, and exactly
shaped torillas. La Maquina es el camino a la
salvacion.
Everything not shaped like an elephant,
Alexander L. Yonderboy
--
Alex Suter
http://world.std.com/~asuter/
"Oh boy! Sleep! That's where I'm a viking!"
Holy crap. Truly, there is no reference so obscure that *somebody* here
won't get it, is there? I saw that big "El Machino" sign hanging from
the ceiling and knew it had to be my next "it means" line.
>Johnny Favorite (it means "El Machino") <al...@snakebite.com> wrote:
>>It's like writing a story. It's not just what you put in, it's also
>>what you leave out.
[x]
"
"
>Everything not shaped like an elephant,
>Alexander L. Yonderboy
Didja notice there are several other Lupus Yonderboys running around,
defaming the family name with their general ineptness?
--
Patrick Phelan
w____\\W//___w Te Hupenui
Specious Axiomatic
http://copeland.choicelogic.com/~phelan/
ALL YOUR REFERENCE ARE BELONG TO US
you have no chance to obscure
MAKE YOUR CALLBACK
Dave 'worst electronic haiku ever' DeLaney
Fuck the OS. Gimme cycles.
'james
This is an outrage. I should be only one defaming my
family name with general ineptness.
That's what I get for stealing a hip name from a hip
character in a cyberhip book.
Had my cyberhip replaced,
Ulysses Everett McYonderboy
I learned C first, and then I went to university and they taught me
Pascal. I couldn't understand how pointers could be useful if you
could't malloc() stuff! STUPID PASCAL!
> I think that the real problem is that C has a distorted view of the
> computer.
Does it bother you that the real problem is that C has a distorted
view of the computer?
> Java really blows chunks because it inherits all the brane-dead
> distortions of C and then throws in all the perversions of C++ and none of
> the good parts of Lisp, and then messes up the whole thing with this awful
> C-style syntax and stupid restrictions like the fscking virutale machine
> and a bozotic single-inheritance object system.
Today I found out that Java allows the ?: syntax!! Like this:
x = a ? b : c;
And I had to debug code written by somebody who didn't use braces to
surround one-line if blocks! I MEAN BLOODY HELL! Why couldn't the
language FORBID the ? : operator, and REQUIRE braces arround all if
and else blocks???
cheers
Beable van Polasm
--
Aaawwww...I gotta keep it out of sci.chem AGAAAINNN????
Doh! Oops....Sowwy Uncle Al.... -- Shane Stephens
IQC 78189333 http://members.nbci.com/_______/index.html
>Today I found out that Java allows the ?: syntax!! Like this:
>x = a ? b : c;
Even better, you can nest ?: blocks.
>And I had to debug code written by somebody who didn't use braces to
>surround one-line if blocks! I MEAN BLOODY HELL! Why couldn't the
>language FORBID the ? : operator, and REQUIRE braces arround all if
>and else blocks???
And you know what would be really nice? That the language require proper
whitespace, so the code always looks nice. That would be great.
--
Patrick Phelan
w____\\W//___w Te Hupenui
Did you like Hawaii? Please pick up your trash.
http://copeland.choicelogic.com/~phelan/
YEAH! And if you try to change your tab settings to something other
than 8, all your code deletes itself! And the compiler deletes itself
too! Oh yeah.
>YEAH! And if you try to change your tab settings to something other
>than 8, all your code deletes itself! And the compiler deletes itself
>too! Oh yeah.
And if you use any editor but emacs, the computer will shoot electricity into
your chest. And if you start Visual Basic, the small thermonuclear device the
UN plants in every computer will be detonated.
--
Patrick Phelan
w____\\W//___w Te Hupenui
An' then it'll be MERRY GIFTMAS, JUDY
http://copeland.choicelogic.com/~phelan/
YEAH! And if you get a LILO prompt which has a choice like:
" LILO boot:
linux windows"
and you choose "windows", the computer turns into a big scary robot
and shouts in a robotty voice: "WRONG ANSWER LITTLE MAN" before
pulling your head off and pouring old sump oil down your neck!
> And if you start Visual Basic, the small thermonuclear device the UN
> plants in every computer will be detonated.
YEAH! WAIT! NO! THE UN TOTALLY DENIES THESE COMPLETELY UNSuBSTANTIATED
ALLEGATIONS OF IMPLANTED THERMONUKULAR DEvICES! (not thermonuclear like
you put Mr PQQPYHEAD)
>fan...@geocities.com (Fantod) writes:
>>
>> And if you use any editor but emacs, the computer will shoot
>> electricity into your chest.
>
>YEAH! And if you get a LILO prompt which has a choice like:
>" LILO boot:
> linux windows"
>
>and you choose "windows", the computer turns into a big scary robot
>and shouts in a robotty voice: "WRONG ANSWER LITTLE MAN" before
>pulling your head off and pouring old sump oil down your neck!
If your LILO prompt is even on the screen for more than 5 seconds, the black
helicopters show up to make sure that the options are different Linux kernels
or distributions, and not Linux and Windows. The jack-booted thugs may accept
"But I just use Windows to play SubSpace." Then again, they may not.
>> And if you start Visual Basic, the small thermonuclear device the UN
>> plants in every computer will be detonated.
>
>YEAH! WAIT! NO! THE UN TOTALLY DENIES THESE COMPLETELY UNSuBSTANTIATED
>ALLEGATIONS OF IMPLANTED THERMONUKULAR DEvICES! (not thermonuclear like
>you put Mr PQQPYHEAD)
BIG BQQM THING
--
Patrick Phelan
w____\\W//___w Te Hupenui
Bellsprout! Bellsprout! You're the best without a doubt!
http://copeland.choicelogic.com/~phelan/
They forgot to teach you about new and delete?
[...]
>
>Today I found out that Java allows the ?: syntax!! Like this:
>x = a ? b : c;
>And I had to debug code written by somebody who didn't use braces to
>surround one-line if blocks! I MEAN BLOODY HELL! Why couldn't the
>language FORBID the ? : operator, and REQUIRE braces arround all if
>and else blocks???
>
Because then it would be Pascal.
I bet you hate it when someone writes something like:
for (i=0; c = getchar(), c != EOF; ++i) {}
--
Sherilyn
The suespammers.org mail server is located in California; do not
send me unsolicited bulk e-mail or unsolicited commercial e-mail.
With Nu Thermo-Nu-Clear, you'll get rid of those disgusting zits and have
HAWT CHYX fondle your body when you wash your face in the morning!
I wonder how much it costs?
James,
> Today I found out that Java allows the ?: syntax!! Like this:
> x = a ? b : c;
> And I had to debug code written by somebody who didn't use braces to
> surround one-line if blocks! I MEAN BLOODY HELL! Why couldn't the
> language FORBID the ? : operator, and REQUIRE braces arround all if
> and else blocks???
The more I use Java, the more I realize it secretly wants to
be C, not C++. Compare and contrast void* and Object.
Seriously.
Never in my life have I seen so much fuggen casting!
ST00PID FUGGEN JAVA!!!!!!!!!
But don't get me wrong, I have no beef with C. At least C
has implicit type casting.
And what is up with this????
public class st00pid {
private Thing _thing;
public Thing getThing() {
return _thing;
}
}
Why "encapsulate" the data with a BLOODY "get" function,
when ALL IT DOES is return a reference to the "private"
FUGGEN DATA!!!!!! WHY IS THIS CONSIDERED NORMAL PRACTICE IN
``JAVA-LAND''????????? THIS IS ST00PID!!!1!!
--
~
~
~
"Daniel Buettner" line 4 of 4 --100%--
>And what is up with this????
>
> public class st00pid {
> private Thing _thing;
>
> public Thing getThing() {
> return _thing;
> }
> }
>
>Why "encapsulate" the data with a BLOODY "get" function,
>when ALL IT DOES is return a reference to the "private"
>FUGGEN DATA!!!!!! WHY IS THIS CONSIDERED NORMAL PRACTICE IN
>``JAVA-LAND''????????? THIS IS ST00PID!!!1!!
May be 1 theory is that if all users of class st00pid use getThing(), you
could later change the precise nature of what thing the Thing is, or
perform some kind of operation to yield a Thing object from some other
non-Thing data, or something. But probably it's just because people are
STUPID but they have been programmed to believe that DATA is always
PRIVATE, even though lots of textbooks for C++, at least, say you should
always have GETTER and SETTER functions! Note that if you have a setter
function you can't even do the sort of doofy-ass encapsulation like I JUST
DESCRIBED. Also writing this reminded me of when I read some C textbook in
a bookstore that had "typedef double dbl;" in all its examples (that I
read). Buh? Oh, it returns a *reference*. In that case that's just dumn.
--
Barnabas T. Rumjuggler
No man can run so fast that he can escape his own past's projectile vomit.
Q: Why should you put "#define PI 3.1415926" in your programs?
A: You should always put "#define PI 3.1415926" in your C programs in
case the value of pi changes later on. If you hard coded that number
in your program, you'd have to go through and change it everywhere!!1!
But that's not the REAL point. The REAL point is WHY IS THIS IMPORTANT
INFORMATION NOT IN THE "C PROGRAMMING FAQ"??? WHY IS THIS IMPORTANT
INFORMATION NOT BEING DISSEMINATED? WHY IS THIS BEING COVERED UP??
WELL PETER SEEBACH??? EXPLAIN YOURSELF!!1
cheers
Beable van Polasm
--
Yes Mr. Miller, (if that is your REAL name), to spell it out even more
clearly, you cannot spell Usenet without UN. It should be obvious to
even the most casual observour. - Chris Franks
http://members.nbci.com/_______/lobster.html
HMMMMMMMMMMMMMMMMMMMMMM. Maybe it was some OTHER reason why I
couldn't understand Pascal's Pointers.
> I bet you hate it when someone writes something like:
> for (i=0; c = getchar(), c != EOF; ++i) {}
No, I like that ok. It's got BRACES!! I don't think the Java
compiler is going to like it, but.
cheers
Beable van Polasm
--
Only when i is not useful.
Jim Smith
PLONK!!
> Beable van Polasm <bea...@my-deja.com> wrote:
>
> > Q: Why should you put "#define PI 3.1415926" in your programs?
>
> INCORRECT ROUNDING! PLONK!
U CAN'T PLONK ME! I PLONKED U FIRST! HAW HAW!
The syntax is weird if you only know C. I came from Pascal to C,
and that sucks, too. Lots of cool code in C, but it's a crappy
language.
[...]
> [...]
>
> That's what I get for stealing a hip name from a hip
> character in a cyberhip book.
>
> Had my cyberhip replaced,
> Ulysses Everett McYonderboy
Leonardo da Yonderbonium.
-jarai.
--
--- Brian Chase | b...@world.std.com | http://world.std.com/~bdc/ -----
MEDITATE ON THIS AT SECOND LEVEL. -- K.
BUG! That's a big fat BUG!!1! It should have been piOVER4=atan(1).
Now I'm going to have to PLONK you.
PLONK!!
cheers
Beable van Polasm
--
This isn't right!! -- WCW Nitro Commentator #1
This is a travesty! -- WCW Nitro Commentator #2
IQC 78189333
http://members.nbci.com/_______/index.html
Blame my maths teacher. pi/4 was pronounced piby4.
pi*4 was pronounce 4pi.
>Now I'm going to have to PLONK you.
>
>PLONK!!
PLONK!!!
So there.
[snip]
>>YEAH! And if you get a LILO prompt which has a choice like:
>>" LILO boot:
>> linux windows"
>>
>>and you choose "windows", the computer turns into a big scary robot
>>and shouts in a robotty voice: "WRONG ANSWER LITTLE MAN" before
>>pulling your head off and pouring old sump oil down your neck!
>If your LILO prompt is even on the screen for more than 5 seconds, the black
>helicopters show up to make sure that the options are different Linux kernels
>or distributions, and not Linux and Windows. The jack-booted thugs may accept
>"But I just use Windows to play SubSpace." Then again, they may not.
LILO? LILO?! The computer should make your brane dribble out your ears
if you try to install LILO instead of Grub.
--
FU
> Beable van Polasm <bea...@my-deja.com> wrote:
[snip]
> >BUG! That's a big fat BUG!!1! It should have been piOVER4=atan(1).
>
> Blame my maths teacher. pi/4 was pronounced piby4.
> pi*4 was pronounce 4pi.
You're both wrong! My college calc TA said it's piDIV4.
> >Now I'm going to have to PLONK you.
> >
> >PLONK!!
>
> PLONK!!!
>
> So there.
There's no way I'm plonking either of you--you're too entertaining.
--Jeremy
------------------------------------------------------------------------------
Jeremy Impson
http://nwc.syr.edu/~jdimpson
>LILO? LILO?! The computer should make your brane dribble out your ears
>if you try to install LILO instead of Grub.
It doesn't offer any features compelling enough to make me install it, while
LILO came with Slack.
Also, "The kernel, in turn, initializes the rest of the operating system
(e.g. GNU)." Still a touchy subject?
--
Patrick Phelan
w____\\W//___w Te Hupenui
Many will enter. Few will win.
http://copeland.choicelogic.com/~phelan/
That's just ST00PID. "BY" is the INTERNATIONALLY RECOGNISED United
Nations word for MULTIPLICATION. I am hereby plonking your maths
teacher FORTHWITH! PLONK! HAW HAW!
> > pi*4 was pronounce 4pi.
What I would do 4 pi right now. MMMMMMMMMMMMMM PIE. Ooh look at the
time: 22:07, TIME FOR PIE!!1!
> You're both wrong! My college calc TA said it's piDIV4.
And I'm plonking her too! PLONK! PLONK!
> > >Now I'm going to have to PLONK you.
> > >
> > >PLONK!!
> >
> > PLONK!!!
> >
> > So there.
>
> There's no way I'm plonking either of you--you're too entertaining.
SUCKING UP! PLONK PLONK PLINK!
cheers
Beable van Polasm
--
"I'm not disembowelling you, I'm kissing you with my entrenching tool."
-- Tom Scudder
http://members.nbci.com/_______/backstreet.html
> If your LILO prompt is even on the screen for more than 5 seconds, the black
> helicopters show up to make sure that the options are different Linux kernels
> or distributions, and not Linux and Windows. The jack-booted thugs may accept
> "But I just use Windows to play SubSpace." Then again, they may not.
SubSpace? Wasn't that a crappy game written in Visual Basic that stole
its mouse pointer from Starcraft?
--
Dag Agren <> d...@c3.cx <> http://www.abo.fi/~dagren/ <> Legalize Oregano
"WinModems are not modems and you don't win anything." - Peter Willard
void main(float argc, char argv[][])
{
#include "stdio";
float x;
scanf("ARE YOU ELEET???: %&d", x);
if (x = "yes")
{
printf(YOU ARE ELLEET!!!!1!
);
}
:x
:wq
ZZ
FUGGEM VI!!1!
}
--
Juan Antonio Samaranch: Aussie, Aussie, Aussie.
Audience: OI! OI! OI!
Juan Antonio Samaranch: Well done.
You misspelled "ELEET" in the print-eff thingy.
Other than that your code is flawless.
-Poot
>In article <Xns90DB5946D6...@199.45.45.11>,
>fan...@geocities.com says...
>
>> The jack-booted thugs may accept "But I just use Windows to play
>> SubSpace." Then again, they may not.
>
>SubSpace? Wasn't that a crappy game written in Visual Basic that stole
>its mouse pointer from Starcraft?
Gasp! No, SubSpace doesn't have a mouse pointer at all, so you must be
thinking of something else. SubSpace is a Massively MultiPlayer Asteroids on
crack.
It was written as a demo of DirectX, so Virgin gave it away for while, then
tried to sell it, then collapsed completely, so now there is a completely new
free version written by someone else.
http://subspacehq.com/
I play in the Survivor zone, if anyone is interested.
--
Patrick Phelan
w____\\W//___w Te Hupenui
How to Make
http://copeland.choicelogic.com/~phelan/
> void main(float argc, char argv[][])
> {
> #include "stdio";
> float x;
> scanf("ARE YOU ELEET???: %&d", x);
> if (x = "yes")
Variable type confusion!
PLONK!
--
Luke Breinig - www.lukebreinig.com - L33T H4><0R!!1!
Amiga 500/1000/3000 - K6-2/450 - PII/300 - Mac IIsi - Apple IIgs - C=64
"smart1234 is getting more insane. Even a car running over him could not
help him." - Kurt Stocklmeir
Intentional obfuscation. Why else would anyone
use an assignment operator to compare a float with
a string? That scanf's a big owie, though, gonna'
ralph on some versions of Unix.
Jim Smith