123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|660|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Pixel-perfect collision detection between types

Sun, 18 Mar 2007, 10:40
Blitz3Dman
I found the coolest game at fallingsandgame.com/sand/pyro.html and I'm trying to make a Blitz version of it but... meh, I can't get the collisions right. When I thought I may've actually had it I found that it was about the slowest game you've ever played running in spf's instead of fps's.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 18 Mar 2007, 11:07
power mousey
...............


Sun, 18 Mar 2007, 11:12
magicman
ah, i remember that game.its pretty sweet. However i dont think that blitz is the right language to try to make it in seeing as how blitz is some what slow when it comes to thousands and thousands of individual paritcals. in a little while i may see if i can help you, but for now i have a couple things to do.

-=-=-
Stuff... Yeah...
Sun, 18 Mar 2007, 11:32
mike_g
Hey blitz3dman, If you post your code maybe someone could help you to optimize it if possible.
Sun, 18 Mar 2007, 11:59
Blitz3Dman


GAH HOW I MAKE SMILEYS GO BYEBYE?

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 18 Mar 2007, 12:21
mike_g
blitz3dman
GAH HOW I MAKE SMILEYS GO BYEBYE?


Dude you put the code in quotes instead of a

Sun, 18 Mar 2007, 12:23
Blitz3Dman
ty very much couldn't figure out the [code]...

@magicman
what language would you recommend?

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 18 Mar 2007, 12:37
mike_g
Since the 'parts' are only 1 pixel big in you prog I would imagine that it would be faster to check to see if they have the same x\y co-ords instead of using RectsOverlap().

The code for checking the parts against one another can also be improved as many of the same checks get repeated. I had once thought about writing a fast collision detection algo, but havent got around to it as of yet.

Also you could maybe make a pile made of lines that the grains fall on to. When the 'parts' hit the pile you can increase the line length and delete the 'part', this could reduce the amount of objects you need to use, and collision detections. If say the difference in height from one line to its neighbour goes over a threshold the heights could be evened out a bit giving the impression of sand rolling down a hill.

Just some ideas for you
Sun, 18 Mar 2007, 13:45
magicman
the language i would recommend is C++ just becasue it is the fastest, however java would be good and blitzmax might even work. now this isnt to say that i dont think you should try it in blitz, im just saying that it might not work as well. but what ever you do i wish you luck.

-=-=-
Stuff... Yeah...
Sun, 18 Mar 2007, 13:53
mike_g
Imho I think that something like this would be do-able in Blitz.
Sun, 18 Mar 2007, 14:45
mike_g
Heres a very simple sandbox prog I made. It aint very realistic, but its a start:

Sun, 18 Mar 2007, 16:19
JL235
Blitz was not made for single pixel drawing, but I don't think it is too slow. 640*480 writePixelFast calls runs at a touch under 50fps on my pc. Drawing a 640x480 image in my old Crimson project (which allows both per-pixel manipulation and pushes the data straight into the frontbuffer) runs at around 55fps. Both methods allow per-pixel manipulation, and this with 640*480 pixels. 90% of the time in that sand game I probably didn't fill half the screen.

Bear in mind that you can happily make this in Blitz, but it won't be lightning fast. Also remember that whatever language you use, the two slow sections will be the vast number of drawing pixels and the iteration over all these types.

As for using a different language, that game was written in Java, so why not make it in Java?

I wouldn't recommend C++ simply because not everything needs to be made in C++ and it'll be much easier in Java. It has more relevance then Blitz, with Java being an industry standard language (iTunes is a Java application, and just the other day I was looking at SEGA Java programming jobs). Java is easier to learn then C++, free, and make learning C++ easier then if you tried learning it directly.

There are also many good books for helping to learn Java. I recommend 'Objects First with Java' which teaches both Java and object-oriented programming.
Sun, 18 Mar 2007, 18:25
Blitz3Dman
Does Java come standard on Windows XP when you buy it or do you have to download it?

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 18 Mar 2007, 19:05
JL235
No. Java is by Sun Microsystems and created by James Gosling (who I got to see last friday when he did a lecture here).

You need the Java Runtime Environment to run Java 'applets' (Java executables). However I'm certain it can be compiled into an executable, which is probably just the normal Java applet with a Java virtual machine to run it. Gosling said that iTunes was written in Java.

However what you really need to compile Java code is the JDK (Java SE 6 (Standard Edition 1.6) Development Kit) which includes the run-time environment.

You'll also need a good editor, the main two being Eclipse (originally by IBM) and NetBeans (by Sun Microsystems so it's officially supported). Both (like the language) are free and all of this is available online. Personally I use Eclipse, but I use it to write primarily in Ruby (which NetBeans also supports (I was wondering how I would sneak Ruby into the topic)). Both IDE's support many languages, but I think Eclipse is a little prettier.

However as Eclipse and NetBeans are large IDE's designed for projects, I'd also recommend a nice simple, multi-language, notepad style IDE like SciTE (which I use). That's useful for when you want to look at a single file quickly without having to open it up in a proper IDE.

Or you could install Solaris 10 which is free and is the Sun Microsystems operating system. It comes with Java (probably integrated in it's kernel). When asked what OS he uses at home, Gosling commented that Java is way faster on Solaris then on any other operating system. He uses Solaris, Macs (although less then he used to) and doesn't have any machines with Windows (he said it's too much trouble to use).

I plan to switch to another OS soon, possibly my free copy of Vista Business, but I am tempted by my copy of Solaris Developer Edition.
Sun, 18 Mar 2007, 19:10
Blitz3Dman
Since when does SciTE do Java?!??!?
Sun, 18 Mar 2007, 19:23
JL235
Since always:


Even supports Blitz Basic, but I was unable (and didn't care) to get it working. It's also very useful, as I can download a code for a wide variety of languages, such as LISP, and still be able to read it with correct syntax highlighting. Useful also for reading C/C++ rather then having to open Visual Studio.

|edit| The above code is a sneak peak of the source code to the soon (hopefully) to be released Pac-Man Greenfoot scenario. |edit|
Mon, 19 Mar 2007, 05:32
Blitz3Dman
I only got Text and AutoIt3 under language. ??
Mon, 19 Mar 2007, 05:48
JL235
Go to the Options menu at the top, and then click on 'open Global options file'. At the bottom of this are lots of languages commented out like '#import Ruby' and '#import Java'. Uncomment them (remove the #) so they say 'import Ruby' or 'import Java' instead, save, close SciTE and re-open. You should now find the languages you uncommented added to the language section.
Mon, 19 Mar 2007, 11:45
svrman
I remember this sometime ago, maybe of help?
https://blitzbasic.com/codearcs/codearcs.php?code=1877

-=-=-
BlitzRSS script back online!
Tue, 20 Mar 2007, 05:31
Blitz3Dman
Exactly what I needed svrman; thank you

@diablos
the global options file is empty. I got the editor for AutoIt, would I need to go get it off SciTE's website if I wanted the extra languages?

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Tue, 20 Mar 2007, 07:07
JL235
My copy of SciTE came with Ruby. I presumed it had just been bundled as is from the SciTE website, maybe it's been set up with extra language support. I've not heard of AutoIt and I am unsure as to how to add extra languages. I believe you add the files somewhere and import them.

However there are lots of text editors like SciTE (many listed here on Wikipedia). If you want to get into programming it is useful to have a good multi-language text editor, simply to allow you to read samples of code from different languages without any hassle.
Tue, 20 Mar 2007, 09:06
Blitz3Dman
Erm, how do I get more languages to use with SciTE then?

And SciTE as a BB code editor would be great. I really like the IDE for SciTE.

This is where I got SciTE from: www.autoitscript.com/autoit3/scite/

Screenshot:img119.imageshack.us/img119/1910/deletemefe7.png

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Tue, 20 Mar 2007, 09:45
JL235
First, the options you can edit may be under 'local', 'user' or maybe 'abbreviations' (but I doubt it) instead of 'global'. This may be different then for me, as you may have installed it slightly differently.

Second, I posted a link to the official site above.

Third, there is help and documentation on where and how to add extra languages on the official site.
Tue, 20 Mar 2007, 10:07
Blitz3Dman
Ahhh... ok, thanks.

And no, all 4 option files are empty.

|edit| Do I have to have the language installed elsewhere to use it? |edit|

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Tue, 20 Mar 2007, 12:29
JL235
If you want to compile in the language, yes. If you want to simply look at source code, no.

I just mentioned it because it's useful to be able to download code in another language and view it with correct syntax highlighting. For example it's rare for code using OpenGL to be written in Ruby, so many of the examples I look at are in other languages.
Wed, 21 Mar 2007, 18:04
Blitz3Dman
Ok, thanks for the [er,]help[/er,] diablos