[Gag] Ball Bucket

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

[Gag] Ball Bucket

Post by newdep »

A bucket of balls...

(load "http://www.nodep.nl/downloads/newlisp/bucket.lsp")

Norman.
-- (define? (Cornflakes))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Lutz,

I cant figure out the problem but it seems there is a memory-leak somewhere
in GS / newlisp or Java... (or a very very full IO buffer that needs to be emptied :-)

When running "bucket.lsp" after 30 minutes the memory consumption
raised to 31.0% that 312 MB..thats a little too much..(and increasing !)

5677 31.0 312m 0 312m 140 312m 984 259 77k R 16 0 21.3 newlisp

Now i cant say its a mistake in the script, because the script does not
add valeus to its variables...but where does it come from?

Norman.
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

great script!

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Awesome! Now rename the app:

Image
(λx. x x) (λx. x x)

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

hehehe...

So here for the fans even more buckets ->

newlisp code in a bucket -> (save to disk first)
(load "http://www.nodep.nl/downloads/newlisp/bucket2.lsp")

Fish in a bucket ->
(load "http://www.nodep.nl/downloads/newlisp/bucket3.lsp")

Donuts in a bucket ->
(load "http://www.nodep.nl/downloads/newlisp/bucket4.lsp")
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Where are the collisions? :-) Hard to do I think.

This takes up 101% of my CPU... :)

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Well the collisions are possible but you get indeed an overload on cpu ;-)

If you have i.e. 200 objects then they have to scan all 199 objects * border of the object + 4 walls in every move per object.. (this can be tuned or done differently, but is a little tricky because we dont use 'sprite' but canvas in GS.. I think this will work
fine with the i.e. SDL lib..

Increase the 120 balls to 200.. you will see you CPU is bussy ;-)..
This is basicly a GS issue regarding "update" ..

But indeed collisions would eb nice ;-) Perhpas ill add it...
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

A multiple 'set' with indexed lists in bucket.lsp causes a cell-memory leak. This will be fixed in the next development version. As a workaround split up the multiple set:

Code: Select all

; change

(set 'tx (L 1) 'ty (L 2) 'X (L 3) 'Y (L 4))

;to

(set 'tx (L 1))
(set 'ty (L 2))
(set 'X (L 3))
(set 'Y (L 4))
now bucket.lsp will run without eating memory.

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

HA you found it !!..thats great ;-)
-- (define? (Cornflakes))

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Hey Norman!

You helped Lutz improve newlisp by way of writing a fun graphics program. Way cool!

If I ever happen to help Lutz, it will be by some fuddy-duddy program. Ha, ha, ha!

--Rick
(λx. x x) (λx. x x)

Locked