Real men don't need to point out what real men does.
:smug:
... :doh:
[QUOTE=ROBO_DONUT;25427653]I think I've just found a new favorite emote.[/QUOTE]
It krakens me up too.
I'm probably going to make a flash game of some sort, don't know what it will be about, thinking of a side scrolling shooter.
[QUOTE=Ortzinator;25429207]It krakens me up too.[/QUOTE]
That's punny.
Just finished adding a Renderer to the Rewrite of my Game.
The networking intermingles well thanks to a shared library though some functions are a bit lacking.
Next step is to add Lua Scripting to the Server.
Now a little colorful example:
[img]http://dl.dropbox.com/u/2014606/netTest.png[/img]
And I give you text, dynamically taken from a font file with freetype, and rendered with OpenGL Core textured quads!
[URL=http://img697.imageshack.us/i/lolsiw.png/][IMG]http://img697.imageshack.us/img697/7782/lolsiw.png[/IMG][/URL]
That took me way longer than it should, but I had to rewrite my shaders and find a way to pack textures.
[QUOTE=Jallen;25422128]Wow I hope you're joking.
Squaring is ONE calculation, finding the square root is many. Please don't post shit you know nothing about, some poor newb might actually believe it.[/QUOTE]
I'm not talking about specific implementations of square or square root functions. I'm talking math. Squaring an integer is a function into the integers. Taking the square root of an integer is a function into the reals and is thus necessarily more complex - regardless of how the functions actually work.
Of course you're right: squaring is faster because it requires fewer calculations. But [i]why[/i] does it require fewer? Because dealing with integers is easier than dealing with real numbers.
[QUOTE=Larikang;25432342]I'm not talking about specific implementations of square or square root functions. I'm talking math. Squaring an integer is a function into the integers. Taking the square root of an integer is a function into the reals and is thus necessarily more complex - regardless of how the functions actually work.
Of course you're right: squaring is faster because it requires fewer calculations. But [i]why[/i] does it require fewer? Because dealing with integers is easier than dealing with real numbers.[/QUOTE]
That's not why at all.
[QUOTE=Jallen;25422621]Yeah that's great, now do that any major language like C, C++, C# or Java
[b]There is no ^ in these languages[/b].[/QUOTE]
[url=http://msdn.microsoft.com/en-us/library/3akey979.aspx]Bitwise OR[/url] :science:
[QUOTE=FerrisWheel;25433715][url=http://msdn.microsoft.com/en-us/library/3akey979.aspx]Bitwise OR[/url] :science:[/QUOTE]
Its Bitwise [b]Exclusive[/b] OR.
Hey guys, could use some advice.
Basically I want to reduce the size of Not Tetris, and the biggest stuff is the music and sounds.
I got the music as ogg and the sounds as wav, because short oggs don't seem to work with the engine.
But I was wondering if there was a format I could use to make it really small? It's just gameboy sound after all. The complete rom was only 32 kb.
Any idea?
Well you could use midi, or something like it.
I'd have to rewrite the songs for that, and it wouldn't sound right, would it?
Try this [url]http://en.wikipedia.org/wiki/VGM_(file_format[/url]), also you might want to talk with Grease monkey on this.
You're going to have to rewrite the songs anyway.
You've got the audio in Vorbis. Vorbis is about as compressed as you can get for raw samples.
What you probably want is some sort of procedural format that actually describes the notes and tones. Something like a chiptune format.
Going from compressed PCM to a chiptune format is like going from a bitmap to vector graphics. It cannot be done short of tracing the original image by hand.
[QUOTE=pikzen;25423258]Sqrt(-1) = i
Squarerooting a negative number only gives an irreal number, so anyways you can only use R >= 0[/QUOTE]
i is not in R. I specified that I am talking about irrational numbers in my post.
[QUOTE=looped;25424283]Been learning SDL, got a box moving around the screen etc. and I feel I'm doing well. I've come to the point that I want to add some OOP and clean it up a bit. I want to be able to reuse basic things (events, loading resources etc). Anyone got a good way of going about these things?[/QUOTE]
Write it in some way that it is not bound to SDL (wrapper classes, templates) or at least so that the SDL calls could easily be replaced.
[QUOTE=Shammah;25424618]That grid is just a graphical grid, a background filler :)
Anyway, since the bullets are all moving each tick with a random speed, amount and angle I suppose there is no way to optimise this a bit? I mean, I could try sorting them, but that requires a huge amount of cpu power aswell.
It just feels weird how my PC can run Crysis on High with 40 Fps but in my own 2D game it drops to 47Fps already with just 250 bullets and nothing else. I could make it multithreaded but I have no idea how more efficient that would be, as I never dealt with multithreading before.
Also, natural logarithm = ln x = e log x whis solves n in e^n = x.
Somebody mixed the natural logarithm up with the normal one, forgot who it was.[/QUOTE]
Because you're comparing a 3D shooter with a 2D bullethell-like game.
In CrySis physics objects can rest and don't need to be recalculated in a tree-structure. If everything would be always moving, then it would also run slow.
Making the collision tests run via mutithreading should about divide the calculations evenly on each core you have. So with 2 cores, you'd so it in about half the time.
There is no normal logarithm. Maybe you mean the logarithm decatis (logarithm of base 10).
[QUOTE=ROBO_DONUT;25427653]I think I've just found a new favorite emote.[/QUOTE]
Mine is :ohdear:
It's just so fucking cute :3
[QUOTE=Chandler;25428137]Facepunch got a whole new set of them from SomethingAwful with the update. My only gripe is that :parrot: did not come with the ugprade :([/QUOTE]
The kraken was there before the VB4 update.
Also, [url]http://www.facepunch.com/misc.php[/url] in case anyone doesn't know.
[QUOTE=Maurice;25433766]Hey guys, could use some advice.
Basically I want to reduce the size of Not Tetris, and the biggest stuff is the music and sounds.
I got the music as ogg and the sounds as wav, because short oggs don't seem to work with the engine.
But I was wondering if there was a format I could use to make it really small? It's just gameboy sound after all. The complete rom was only 32 kb.
Any idea?[/QUOTE]
I've been using xm-files (extended module). It's a chiptune-format (like you were already suggested to use).
[QUOTE=Maurice;25433766]Hey guys, could use some advice.
Basically I want to reduce the size of Not Tetris, and the biggest stuff is the music and sounds.
I got the music as ogg and the sounds as wav, because short oggs don't seem to work with the engine.
But I was wondering if there was a format I could use to make it really small? It's just gameboy sound after all. The complete rom was only 32 kb.
Any idea?[/QUOTE]
Stuff all your resources into an LZMA compressed archive :pseudo:
As I recall Not Tetris uses LOVE, or has that changed?
[QUOTE=Larikang;25432342]I'm not talking about specific implementations of square or square root functions. I'm talking math. Squaring an integer is a function into the integers. Taking the square root of an integer is a function into the reals and is thus necessarily more complex - regardless of how the functions actually work.
Of course you're right: squaring is faster because it requires fewer calculations. But [i]why[/i] does it require fewer? Because dealing with integers is easier than dealing with real numbers.[/QUOTE]
God you're fucking stupid.
edit: actually no, sorry I get a bit carried away, but seriously what you are saying [I]is[/I] stupid.
You obviously know nothing about programming and have never even attempted to write your own square root implementation. It has nothing to do with using real numbers. You don't use [I]real[/I] real numbers in programming, you use approximations. They have limited size and precision.
Look at this code.
[code]
double y = 3.2874294532 / 7.38749274;
[/code]
That will execute MUCH faster than sqrt(). It is one double division calculation.
Here are several sqrt implementations.
[url]http://www.codeproject.com/KB/cpp/Sqrt_Prec_VS_Speed.aspx[/url]
Yeah, totally has everything to do with using real numbers, right? :downs:
As I said before, don't spew shit you know nothing about, some poor beginner might actually believe it.
[QUOTE=Larikang;25432342]I'm not talking about specific implementations of square or square root functions. I'm talking math. Squaring an integer is a function into the integers. Taking the square root of an integer is a function into the reals and is thus necessarily more complex - regardless of how the functions actually work.
Of course you're right: squaring is faster because it requires fewer calculations. But [I]why[/I] does it require fewer? Because dealing with integers is easier than dealing with real numbers.[/QUOTE]
I have never ever had to get involved in one of these arguments before but it has nothing to do with integers and real numbers. When you square something your doing very few operations, just multiplying the same number. However, when you square root - floats or not - your doing lots of operations.
For example, in c++ squaring could just be done by doing:
[code]
int a = 4*4;
[/code]However, if you wanted to find the square root the code you use looks something like this: (this is just somethign I grabbed of google)
[code]
double sqrt(double num)
{
double mod=1;
double c=0;
for(int d=0; d<50; c+=mod, d++)
if(c*c>num)
{
c-=mod;
mod/=10;
}
return c;
}
[/code]
Do you get it now?! Some times people can be so stupid it actually hurts deep inside.
[code]#include <iostream>
#include "math.h"
#include "windows.h"
int main()
{
const unsigned long z = 10000000;
DWORD t1;
std::cout<< "Doing " << z << " integer divisions.\n";
t1 = GetTickCount();
for(int i = 0; i < z; i++) 54321 / i;
std::cout<< "Time taken: " << GetTickCount() - t1 << "ms\n\n";
std::cout<< "Doing " << z << " integer multiplications.\n";
t1 = GetTickCount();
for(int i = 0; i < z; i++) i * 54321;
std::cout<< "Time taken: " << GetTickCount() - t1 << "ms\n\n";
double d = 54673.439657368873678;
std::cout<< "Doing " << z << " double divisions.\n";
t1 = GetTickCount();
for(double i = 0.345322564; i < z; i++) i / d;
std::cout<< "Time taken: " << GetTickCount() - t1 << "ms\n\n";
std::cout<< "Doing " << z << " double multiplications.\n";
t1 = GetTickCount();
for(double i = 0.345322564; i < z; i++) i * d;
std::cout<< "Time taken: " << GetTickCount() - t1 << "ms\n\n";
std::cout<<"Doing " << z << " double sqrts (using math.h sqrt implementation).\n";
t1 = GetTickCount();
for(double i = 0.345322564; i < z; i++) sqrt(i);
std::cout<< "Time taken: " << GetTickCount() - t1 << "ms\n\n";
getchar();
return 0;
}
[/code]
[img]http://dl.dropbox.com/u/5062494/forumpost/sqrt_speed.PNG[/img]
Done on a netbook, hence the slow times.
Dont know if anyone is interested, but i just created a group for anyone that uses C++
[url]http://www.facepunch.com/group.php?groupid=1896[/url]
[QUOTE=Matthew0505;25429184]On topic
What shape is the bullet? If it's a circle then this collision check can easily be optimised[/QUOTE]
The player is a circle, but the bullet can either be a circle, square or equally sided triangle.
[QUOTE=ZeekyHBomb;25434647]
Because you're comparing a 3D shooter with a 2D bullethell-like game.
In CrySis physics objects can rest and don't need to be recalculated in a tree-structure. If everything would be always moving, then it would also run slow.
Making the collision tests run via mutithreading should about divide the calculations evenly on each core you have. So with 2 cores, you'd so it in about half the time.
There is no normal logarithm. Maybe you mean the logarithm decatis (logarithm of base 10).
[/QUOTE]
It still baffles me :)
And yeh, sorry, I meant a base 10 logarithm, but forgot it was base 10 since I don't write it explicitly.
[QUOTE=looped;25424283]Been learning SDL, got a box moving around the screen etc. and I feel I'm doing well. I've come to the point that I want to add some OOP and clean it up a bit. I want to be able to reuse basic things (events, loading resources etc). Anyone got a good way of going about these things?[/QUOTE]
I am only learning myself, but this is the structure I have used, and it has worked well.
Have a main.cpp that holds the draw loop, event loop, and general initilization.
Have a (projectname).cpp and a (projectname).h file. Inside those have a class named after the project that has three funcitions, moveall() and drawall(), and an initializer. Inside the class it should have several private other classes to represent other things like backgrounds, players, etc.
The moveall() and drawall() functions should call moveall() and drawall() on classes contained in the main one, which can then call move() and draw() on their contained classes as well.
The initializer should initialize everything(load textures, load shaders, etc).
There should be only three project specific things the main.cpp file would have: a pointer to the main class, that is then initialized with new in a init function, a call to drawalll() on the class in the graphics loop, and a call to moveall() on the class in the render loop.
As for reusing resource loading...
Have a util.cpp and a util.h file. These will holds several functions like loading textures into memory, initilizing graphics, loading shaders into memory, xml functions etc. Use this file when writing your classes.
If anyone can offer any improvements, I did say I was still learning.
What can I make?
I'm trying to get gtkd samples to compile :/ under both D1 and D2 they spit out errors.
[editline]16th October 2010[/editline]
This is so annoying.
[QUOTE=Jawalt;25439205]I'm trying to get gtkd samples to compile :/ under both D1 and D2 they spit out errors.
[editline]16th October 2010[/editline]
This is so annoying.[/QUOTE]
What errors are you getting?
Oh wow, so now it does compile, but instead of the expected GTK window I get nothing :( no error messages or anything.
[editline]16th October 2010[/editline]
[QUOTE=jA_cOp;25439272]What errors are you getting?[/QUOTE]
I solved those, using D1 it turned out to be my project settings, so now it's compiling, just not working.
[editline]16th October 2010[/editline]
I'll post this in the help thread.
[QUOTE=Maurice;25433766]Hey guys, could use some advice.
Basically I want to reduce the size of Not Tetris, and the biggest stuff is the music and sounds.
I got the music as ogg and the sounds as wav, because short oggs don't seem to work with the engine.
But I was wondering if there was a format I could use to make it really small? It's just gameboy sound after all. The complete rom was only 32 kb.
Any idea?[/QUOTE]
I would use something like "module music".
[url]http://en.wikipedia.org/wiki/Module_file[/url]
See Scream tracker, Modplug Tracker.
This, however, requires the music to be composed for module format. - This is the way Unreal tournament used to do its music.
They are basically a MIDI file, but you supply the samples.
Yay, Late - Hey if a solution crops up many times, it must be a good one?
Sorry, you need to Log In to post a reply to this thread.