[QUOTE=Quark:;31632181]Personally, I've been wanting to try Squirrel in one of my applications..[/QUOTE]
Same here, but getting it around to working took a bit of work from my side. Totally worth it though!
[QUOTE=X-Neon;31371815]Started working on a solar system simulator thing for school. Got the Earth orbiting the Sun.
The only problem is the orbit is circular and not elliptical. Any idea why?[/QUOTE]
...because circles [i]are[/i] ellipses!
(I have no idea, I just wanted to say that.)
[QUOTE=DoctorSalt;31633367]...because circles [i]are[/i] ellipses!
(I have no idea, I just wanted to say that.)[/QUOTE]
That is true. Earth's orbit has an eccentricity (0 is a circle, 1 is a parabola, between is an ellipse) of 0.0167 (according to Wikipedia, so [citation needed]), which makes it almost a perfect circle.
[QUOTE=Neo Kabuto;31633590]That is true. Earth's orbit has an eccentricity (0 is a circle, 1 is a parabola, between is an ellipse) of 0.0167 (according to Wikipedia, so [citation needed]), which makes it almost a perfect circle.[/QUOTE]
But then again that 0.0167 difference is on a galactic scale, so that orbit is probably thousands of miles off being a perfect circle :v:
[QUOTE=Neo Kabuto;31633590]That is true. Earth's orbit has an eccentricity (0 is a circle, 1 is a parabola, between is an ellipse) of 0.0167 (according to Wikipedia, so [citation needed]), which makes it almost a perfect circle.[/QUOTE]
That's actually a huge difference. That's a 1.7% error from a circle...
[QUOTE=Jawalt;31633829]That's actually a huge difference. That's a 1.7% error from a circle...[/QUOTE]
It's a huge difference by the numbers, but it might be easy to miss looking at a picture of it.
This is more hardware then WAYWO, but hey. I'm working on it.
[thumb]http://dl.dropbox.com/u/5270951/Pics/2011-08-09%2018.37.06.jpg[/thumb]
My question/request is, does anyone know how to detect beats in music?
Preferably in real time, and from the line out? (and in C#) I researched it, but I could only really find some C++ unmanaged library (fmod?) and a C# wrapper for it. That didn't really work.
The guy who made the Sexually exhilarating music visualizer did it, so its possible.
[noparse][thumb]url[/thumb][/noparse]
[QUOTE=bobthe2lol;31635753]snipsomemoar[/QUOTE]
[noparse][t]<image>[/t] or [thumb]image[/thumb][/noparse]
[editline]9th August 2011[/editline]
Pull the trigger, thelinx
[QUOTE=Richy19;31632712]This was a pretty good article on the different scripting languages [url]http://codeplea.com/game-scripting-languages[/url] but it doesnt seem to open anymore.
In speed it basically was Pawn > GameMonkey > Lua > AngelScript > Squirrel
That said they did say that squirrel was one of the easiest to use, pawn being the hardest.
And other that Lua, squirrel had the most commercial usage (Portal 2 and L4D2 uses it)
Lua seemed to be the most neutral in all fields.[/QUOTE]
Google cached it:
[url]http://webcache.googleusercontent.com/search?q=cache:vozdkFXUN10J:codeplea.com/game-scripting-languages+http://codeplea.com/game-scripting-languages&cd=1&hl=nl&ct=clnk&gl=nl&source=www.google.nl[/url]
[QUOTE=Overv;31636191]Google cached it:
[url]http://webcache.googleusercontent.com/search?q=cache:vozdkFXUN10J:codeplea.com/game-scripting-languages+http://codeplea.com/game-scripting-languages&cd=1&hl=nl&ct=clnk&gl=nl&source=www.google.nl[/url][/QUOTE]
:D I tried looking for how to look up google chache's but couldnt find anything, thanks
[QUOTE=Overv;31636191]Google cached it:
[url]http://webcache.googleusercontent.com/search?q=cache:vozdkFXUN10J:codeplea.com/game-scripting-languages+http://codeplea.com/game-scripting-languages&cd=1&hl=nl&ct=clnk&gl=nl&source=www.google.nl[/url][/QUOTE]
I don't understand why more people don't think to use JavaScript as a scripting language for games. It is [i]the[/i] perfect scripting language in my opinion. V8 is fast, very fast, and it's widespread use means that there is documentation and help for it everywhere.
Honestly, it's hard to take any of the languages listed there serious barring Lua and Pawn.
Squirrel seems a bit like... a bastard child of Lua, Python, and other influences yet less well thought out than any of those.
Angelscript is... C++ without the reasons C++ is so good... because it's a low level object oriented language.
And Gamemonkey seems to have little community or 3rd party support.
Lua's biggest advantage here though I think, is the volume of 3rd party libraries, tutorials, and knowledgeable users.
[editline]9th August 2011[/editline]
Quark... why would you rate this programming king?
[QUOTE=Jawalt;31636837]Quark... why would you rate this programming king?[/QUOTE]
I bestow up thee, fair prince, the honor of the throne - you are the king of all programmers.
[QUOTE=Overv;31630536]Nice art style, did you do it yourself?[/QUOTE]
It looks like the PureBDCraft texture pack for Minecraft.
I just built V8, which resulted in this beast:
[img]http://images.overvprojects.nl/SS-2011-08-10_03.56.00.png[/img]
It takes about 3 minutes to build the hello world application.
anyone else make heavy use of the Pimpl idiom? i find it extremely useful, completely removes the need to clutter the public interface (the header) with implementation details (private members)
[editline]10th August 2011[/editline]
plus, major benefits in compile time
[QUOTE=bobthe2lol;31635753]This is more hardware then WAYWO, but hey. I'm working on it.
[thumb]http://dl.dropbox.com/u/5270951/Pics/2011-08-09%2018.37.06.jpg[/thumb]
My question/request is, does anyone know how to detect beats in music?
Preferably in real time, and from the line out? (and in C#) I researched it, but I could only really find some C++ unmanaged library (fmod?) and a C# wrapper for it. That didn't really work.
The guy who made the Sexually exhilarating music visualizer did it, so its possible.[/QUOTE]
I searched for beat detection a while ago but couldn't find anything but people taking averages and when something goes above it you have a beat :S If you find some numbers for the time of music that you need to take the avarage of and how much above the average you had to be for a program to detect beats properly please share :)
Idk about C# libraries(dont do any managed stuff) but FMOD worked for me in C++. Maybe try OpenAL(?)
[QUOTE=icantread49;31639425]anyone else make heavy use of the Pimpl idiom? i find it extremely useful, completely removes the need to clutter the public interface (the header) with implementation details (private members)
[editline]10th August 2011[/editline]
plus, major benefits in compile time[/QUOTE]
I'll clutter your public interface with my private member.
:quagmire:
[QUOTE=icantread49;31639425]anyone else make heavy use of the Pimpl idiom? i find it extremely useful, completely removes the need to clutter the public interface (the header) with implementation details (private members)
[editline]10th August 2011[/editline]
plus, major benefits in compile time[/QUOTE]
My shitty threading library synk uses (or used? I started to rewrite some portions so it probably doesn't work anymore/doesn't use pimpl) the pimpl idiom. I ended up gravitating away from it for other projects because at some point you might need to allow two private implementation files to have direct access to each other (i.e., in the case of a condition variable on POSIX machines), and then it all goes to shit faster than a G8 summit riot (look how clever I am, making a joke about current/past events, but staying politically correct)
I found I got better performance once the API for a given set of headers was frozen, and then I used a precompiled header. Most of the compile times also disappeared when I did that with a given STL header. I also had a "precompile.hpp" file for a project, which did an instantiation of the STL types I used without actually creating any variables, and that was placed into the precompiled header as well (within the frozen API).
I eventually stopped doing all this because clang finally became stable and standards compliant, so my 'in development' stuff compiled faster, and I didn't have to do some weird as all get out optimizations for a debug build to compile faster.
Then I decided I should probably just stick with C, because I was [i]compiling headers so that I could compile source files just a fraction of a second faster[/i].
I miss namespaces :(
I was bored in Physics class, so I made a fluid-wave-simulator-thing using LuaJIT.
(deprecated OpenGL... whoo!)
[img]http://localhostr.com/file/P8o7jT9/waves.png[/img]
Why do I keep getting dumbed by randoms with 8-15 posts?
[editline]9th August 2011[/editline]
In this thread specifically, this was meant to merge with my last post on the last page :S.
[QUOTE=Chandler;31639713]at some point you might need to allow two private implementation files to have direct access to each other (i.e., in the case of a condition variable on POSIX machines)[/QUOTE]
You sure they [i]both[/i] need direct access to each other?
I have a Simulation class, a SimulationImpl class (the Pimpl), a GamePhysical class, and a GamePhysicalImpl class (the Pimpl); each has its own header file, but the implementations of the actual class and the Pimpl class reside in the same source file. This way, if one private implementation needs another private implementation, it can just include the proper header file and call something like mySimulation->Impl()->SomePrivateStuff(). Of course, this works on the assumption that common source files won't even include the Pimpl headers.
[editline]10th August 2011[/editline]
The reason I did this was to keep Box2D includes completely out of any unrelated source files that might decide to run a Simulation or create a GamePhysical component. This way, only the implementations of GamePhysical and Simulation actually include Box2D.
Similar applies to Renderer and SFML includes.
[QUOTE=Jawalt;31636837]Honestly, it's hard to take any of the languages listed there serious barring Lua and Pawn.
Squirrel seems a bit like... a bastard child of Lua, Python, and other influences yet less well thought out than any of those.
Angelscript is... C++ without the reasons C++ is so good... because it's a low level object oriented language.
And Gamemonkey seems to have little community or 3rd party support.
Lua's biggest advantage here though I think, is the volume of 3rd party libraries, tutorials, and knowledgeable users.
[editline]9th August 2011[/editline]
Quark... why would you rate this programming king?[/QUOTE]
Angelscript has huge advantages.. It makes sense to embed a scripting language with the same paradigm as your engine. I can move code around easily, allowing me to choose to make my engine more flexible, moving to script, or more efficient, by moving to C++, in seconds as compared to writing and binding in Lua for hours on end. The language is designed for the same design paradigm as C++ and the API is really simple to use in C++, considering the two languages complement each other in so many ways, there's no complicated binding routines to learn about, and no problems that arise from using the automated binding generation tools for Lua. Strong typing in the language might not suit somebody like a level designer, but it helps make code much more self-documenting and can increase efficiency for the VM as it doesn't have to determine the type of a variable during runtime.
[QUOTE=icantread49;31641343]You sure they [i]both[/i] need direct access to each other?[/QUOTE]
The way that a posix condition variable works, is that it requires a pthread_mutex_t* when you call wait. You can read more about it [url=https://computing.llnl.gov/tutorials/pthreads/man/pthread_cond_wait.txt]here[/url].
Now granted, at the time, I had implemented my pimpl setup in such a way that the pimpl type was an opaque pointer. You could get it, sure, but you couldn't access the pthread_mutex_t*, because the pimpl was opaque. I ended up going the boost route, where you could technically include any header you wanted, but I ended up with this disgusting file hierarchy that really made me loathe the C family language header system more than I already did. It was way too much work, especially if I had to change the whole interface. But I digress.
F# is pretty awesome, but I've been running into a bunch of warts. Within F#, there is an immutable list type. It's called List<'T> (where a 'T is a runtime generic). There's a shorthand version of this type called 'list', so a list<string> becomes a 'string list'. If you open System.Collections.Generic, you then will create a List<T> ([i]not to be confused with a List<'T>[/i]). A list<string> and a List<string> are not the same. But wait, there's more. The F# types currently focus on doing something to the effect of <TypeName>.static_member for functions. So a List.map function takes a List<'T> not a List<T>. See where I'm going with this? It seems that the best thing to do when converting between these types is something to the effect of a sequence conversion where you use the yield-bang operator.
So a List<T> inherits from an IEnumerable, (as do all of the F# types), and a yield-bang results in a lazy conversion and evaluation of the IEnumerable, so you can avoid an unnecessary allocation until you really need to. For reference, here's a recursive glob function that I've written to work sort of like the Python glob function. The only difference is that it relies on the Windows pattern matching items, so a * and a ? are the only available types, no ![seq] or [seq] fnmatch filters will work.
[code]
let glob ([<ParamArray>] patterns:string[]) =
let rec get (path:string) (patt:string) : seq<string> =
seq {
yield! Directory.EnumerateFiles(path, patt)
for pth in Directory.EnumerateDirectories(path) do
yield! get pth patt
}
seq { for pattern in patterns do yield! get "." pattern }
[/code]
So it can be used like so.
[code]
let files = glob('*.xml', '*.cs')
[/code]
Now the best thing about this, is that 'files' isn't actually a list of all the files. The actual glob function won't be called until we evaluate what files contains. Until then it's a shadow sequence. It can be a bit confusing in F#, especially when Haskell is a Pure FP language and only ever does lazy evaluation. F# does eager eval (like C#, C++, C, etc.), but some constructs within the language result in lazy eval without the need for the lazy keyword.
It definitely feels like F# is a bit of a beast, but I find it really exciting, and am falling in love with it, warts or no. :v:
[QUOTE=bobthe2lol;31635753]This is more hardware then WAYWO, but hey. I'm working on it.
//image snip
My question/request is, does anyone know how to detect beats in music?
Preferably in real time, and from the line out? (and in C#) I researched it, but I could only really find some C++ unmanaged library (fmod?) and a C# wrapper for it. That didn't really work.
The guy who made the Sexually exhilarating music visualizer did it, so its possible.[/QUOTE]
You can do this using FFTs (Fast Fourier Transforms.) A quick Google of "FFT C#" led me to: [url]http://www.aforgenet.com/framework/[/url] which may be what you're looking for.
I've used both FMOD and BASS ([url]http://www.un4seen.com/[/url])- They both can do what you need. (I've never used them with C# however.)
[QUOTE=Deco Da Man;31639847]I was bored in Physics class, so I made a fluid-wave-simulator-thing using LuaJIT.
(deprecated OpenGL... whoo!)
[img]http://localhostr.com/file/P8o7jT9/waves.png[/img][/QUOTE]
I thought LuaJIT only had FFI support on the way, but it's already supported? Fucking sweet.
[QUOTE=thelinx;31643016]I thought LuaJIT only had FFI support on the way, but it's already supported? Fucking sweet.[/QUOTE]
Not just simple FFI support but also parsing of C(++) header files and [u]total[/u] optimisation of data types and function calls (as if you'd called it straight from C).
No support for callbacks yet, though :(
I stumbled across [url=https://github.com/malkia/ufo]some guy's LuaJIT package[/url]; it has premade bindings for [url=https://github.com/malkia/ufo/blob/master/ffi/OpenGL.lua]OpenGL[/url] and other commonly used libraries.
[cpp]
#include "lua/lua.hpp"
int main(){
Lua::File("test.lua");
return 0;
}
[/cpp]
test.lua
[lua]
function main()
for i=1, 10 do
print("Lol number " .. i)
end
end
main()
[/lua]
[code]Lol number 1
Lol number 2
Lol number 3
Lol number 4
Lol number 5
Lol number 6
Lol number 7
Lol number 8
Lol number 9
Lol number 10
[/code]
Well, that was easy.
I like LuaJIT with my little wrapper singleton.
[QUOTE=WeltEnSTurm;31644146][cpp]
#include "lua/lua.hpp"
int main(){
Lua::File("test.lua");
return 0;
}
[/cpp]
test.lua
[lua]
function main()
for i=1, 10 do
print("Lol number " .. i)
end
end
main()
[/lua]
[code]Lol number 1
Lol number 2
Lol number 3
Lol number 4
Lol number 5
Lol number 6
Lol number 7
Lol number 8
Lol number 9
Lol number 10
[/code]
Well, that was easy.
I like LuaJIT with my little wrapper singleton.[/QUOTE]
It'd be much better & more useful if it wasn't a singleton IMO
Sorry, you need to Log In to post a reply to this thread.