Finished my text rendering system.
[img]http://i3software.org/s/SS-2011-08-18_18.09.36.png[/img]
Two Classes: GUILetter and GUIWord.
GUILetter is a single char letter. It has a location and a color.
GUIWord is a List<GUILetter>. It has a color that gets passed onto the letter and a top-left location.
[editline]18th August 2011[/editline]
[code]
GUIWord word = new GUIWord("hi fp", new Point(10, 10), Color.Black);
GUIWord word2 = new GUIWord("text is great", new Point(10, 70), Color.White);
GUILetter hLetter = new GUILetter('h');
word.Render(spriteBatch);
word2.Render(spriteBatch);
hLetter.Render(spriteBatch);
[/code]
Now that I'm done with beat boxing with Windows, I'm thinking about making a Pandemic clone, but the world map will be a massive bitch.
[editline]19th August 2011[/editline]
Since I have no idea to make the bitch of a world map work, I'll make a 2D engine instead.
[QUOTE=Foda;31802683]Goddamnit. I guess XNA does not support SIMD? I have a buttload of particles that I need to render/update and I want a really fast way to do it without having to rewrite my entire particle system to be GPU based...[/QUOTE]
XNA is just a framework/library. You mean that the CLR JIT doesn't support SIMD (not sure if it does or not, guessing not). It might pay to write your performance sensitive code in C and P/Invoke across to it from .NET.
Oh god. Just tried Valgrind and I absolutely love it. Caught a very sneaky memory-related bug with it.
I was stress testing Voronoi diagram code and was an inch away from writing it again from scratch, and then I (re-?)discovered this (with Valgrind):
[cpp]
//const wchar_t *wFileName = pTexture->name.GetUnicode().c_str();
const char *fileName(pTexture->name.Get().c_str());
...
imageFormat = FreeImage_GetFIFFromFilename( fileName );
[/cpp]
I blame Garry (Gwen), but I guess it's my fault for overlooking that. (The commented-out line was Garry's code. With Linux kernel wchar support being flaky, I had to use chars).
(For the not-so-C++-savvy, the memory pointed to by c_str() is freed very quickly because the string it is derived from reaches the end of its life immediately after the call.)
The weird part is that I only had problems when I generated a Voronoi diagram with more input vertices.
[img]http://eagle.undo.it:8083/img/kintel_65.png[/img]
Attempting my first actual game in XNA after lots of experimentation.
Pretty simple game where you control the red block and dodge/catch (Haven't decided yet) the blue falling blocks.
[IMG]http://i.imgur.com/IMwTm.png[/IMG]
Completed the input/movement, half of the collision and the dropping of one Blue box.
:D
[QUOTE=Night-Eagle;31820874]The weird part is that I only had problems when I generated a Voronoi diagram with more input vertices.[/QUOTE]
When you free memory, it doesn't immediately get destroyed. You just relinquish any responsibility over it, but the data itself might stay intact for a while.
And it probably did, if you try to allocate more and more memory (or just more often) (-> more vertices), then the chance that this memory will be overwritten with something else is higher of course.
[QUOTE=Night-Eagle;31820874]With Linux kernel wchar support being flaky, I had to use chars[/QUOTE]
linux prefers UTF-8 (the superior encoding :v:)
[QUOTE=i300;31815203]Finished my text rendering system.
[img]http://i3software.org/s/SS-2011-08-18_18.09.36.png[/img]
Two Classes: GUILetter and GUIWord.
GUILetter is a single char letter. It has a location and a color.
GUIWord is a List<GUILetter>. It has a color that gets passed onto the letter and a top-left location.
[editline]18th August 2011[/editline]
[code]
GUIWord word = new GUIWord("hi fp", new Point(10, 10), Color.Black);
GUIWord word2 = new GUIWord("text is great", new Point(10, 70), Color.White);
GUILetter hLetter = new GUILetter('h');
word.Render(spriteBatch);
word2.Render(spriteBatch);
hLetter.Render(spriteBatch);
[/code][/QUOTE]
I don't see the letter h getting rendered :/
Just fucking around with some ideas for Ludum Dare this weekend, hopefully the themes I'm playing around with will get chosen.
[QUOTE=s0ul0r;31822018]I don't see the letter h getting rendered :/[/QUOTE]Because it's never assigned a position or anything, I imagine it's either off-screen or he broke it.
[QUOTE=i300;31815203]Finished my text rendering system.
[img]http://i3software.org/s/SS-2011-08-18_18.09.36.png[/img]
Two Classes: GUILetter and GUIWord.
GUILetter is a single char letter. It has a location and a color.
GUIWord is a List<GUILetter>. It has a color that gets passed onto the letter and a top-left location.
[editline]18th August 2011[/editline]
[code]
GUIWord word = new GUIWord("hi fp", new Point(10, 10), Color.Black);
GUIWord word2 = new GUIWord("text is great", new Point(10, 70), Color.White);
GUILetter hLetter = new GUILetter('h');
word.Render(spriteBatch);
word2.Render(spriteBatch);
hLetter.Render(spriteBatch);
[/code][/QUOTE]
This is a ridiculous nitpick, like -ridiculous- but why would you call that variable hLetter? I'd have probably called it letterH or letterh, just because in speach you say "The letter h" not "the h letter".
[editline]19th August 2011[/editline]
I don't really mean this all that seriously btw.
Figured I'd make a post in here since it is programming. If this doesn't belong here, sorry!
[media]http://www.youtube.com/watch?v=4CqTi0-NNHw[/media]
This is a mod for minecraft that basically makes you character build .schematic files that you load. It works fully in SMP without the need of any mods or anything happening on the server.
[QUOTE=Yogurt;31822785]Figured I'd make a post in here since it is programming. If this doesn't belong here, sorry!
[media]http://www.youtube.com/watch?v=4CqTi0-NNHw[/media]
This is a mod for minecraft that basically makes you character build .schematic files that you load. It works fully in SMP without the need of any mods or anything happening on the server.[/QUOTE]
What is the music from?
[QUOTE=Richy19;31822902]What is the music from?[/QUOTE]
Portal 2 OST, "I saw a deer today."
Decided to test Kari's speed against some other popular languages.
[b]Kari:[/b]
[code]
(n ->
1 => a
0 => b
for 1 n (
b => c
a => b
+ a c => a
)
a
) => fib
fib 100000
[/code]
[b]Ruby:[/b]
[code]
def fib(n)
a = 1
b = 0
n.times do
c = b
b = a
a += c
end
a
end
fib 100000
[/code]
[b]Python:[/b]
[code]
def fib(n):
a = 1
b = 0
i = 0
while i < n:
c = b
b = a
a += c
i += 1
return a
fib(100000)
[/code]
....aaand the results:
[img]http://i.imgur.com/FQzhT.png[/img]
Neat.
To be fair, beating Ruby and Python in terms of speed isn't really a ground-breaking achievement.
[QUOTE=moonage;31823773]Decided to test Kari's speed against some other popular languages.
[b]Kari:[/b]
[code]
(n ->
1 => a
0 => b
for 1 n (
b => c
a => b
+ a c => a
)
a
) => fib
fib 100000
[/code]
[b]Ruby:[/b]
[code]
def fib(n)
a = 1
b = 0
n.times do
c = b
b = a
a += c
end
a
end
fib 100000
[/code]
[b]Python:[/b]
[code]
def fib(n):
a = 1
b = 0
i = 0
while i < n:
c = b
b = a
a += c
i += 1
return a
fib(100000)
[/code]
....aaand the results:
[img]http://i.imgur.com/FQzhT.png[/img]
Neat.[/QUOTE]
Beat lua in speed, and I'll think about getting impressed.
[img]http://i.imgur.com/mIwpb.jpg[/img]
[QUOTE=T3hGamerDK;31824073]Beat lua in speed, and I'll think about getting impressed.[/QUOTE]
Not a chance, Lua does that in 7ms
[QUOTE=moonage;31823773]Decided to test Kari's speed against some other popular languages.
[b]Kari:[/b]
[code]
(n ->
1 => a
0 => b
for 1 n (
b => c
a => b
+ a c => a
)
a
) => fib
fib 100000
[/code]
[b]Ruby:[/b]
[code]
def fib(n)
a = 1
b = 0
n.times do
c = b
b = a
a += c
end
a
end
fib 100000
[/code]
[b]Python:[/b]
[code]
def fib(n):
a = 1
b = 0
i = 0
while i < n:
c = b
b = a
a += c
i += 1
return a
fib(100000)
[/code]
....aaand the results:
[img]http://i.imgur.com/FQzhT.png[/img]
Neat.[/QUOTE]
Try it with node / v8
[QUOTE=Xeon06;31824340]Try it with node / v8[/QUOTE]
I tried a whole bunch of languages:
C - 2ms
Lua - 7ms
C# - 25ms
PHP - 27ms
Perl - 39ms
Node - 60ms
Kari - 211ms
Ruby - 304ms
Python - 930ms
Scheme - 1282ms
[QUOTE=Xeon06;31824340]Try it with node / v8[/QUOTE]
Why? And here's my result from a netbook running Fedora 15.
[code]
(lua)
code:
function fib(n)
a = 1
b = 0
i = 0
while i<n do
c = b
b = a
a = a+c
i = i+1
end
end
fib(100000)
time:
real 0m0.170s
user 0m0.147s
sys 0m0.004s
(Node JS)
code:
function fib(n) {
var a = 1;
var b = 0;
var i = 0;
while( i < n ) {
var c = b;
b = a;
a += c;
i += 1;
}
return a;
}
fib(100000);
time:
real 0m0.234s
user 0m0.182s
sys 0m0.031s
[/code]
[QUOTE=moonage;31825008]I tried a whole bunch of languages:
C - 2ms
Lua - 7ms
C# - 25ms
PHP - 27ms
Perl - 39ms
Node - 60ms
Kari - 211ms
Ruby - 304ms
Python - 930ms
Scheme - 1282ms[/QUOTE]
Lua is faster than C#? Huh.
[editline]19th August 2011[/editline]
In this case.
[QUOTE=BlkDucky;31825058]Lua is faster than C#? Huh.
[editline]19th August 2011[/editline]
In this case.[/QUOTE]
Why is that surprising?
[QUOTE=T3hGamerDK;31825099]Why is that surprising?[/QUOTE]
I don't know. I just always assumed C# would be faster than Lua for some reason.
[QUOTE=moonage;31825008]I tried a whole bunch of languages:
C - 2ms
Lua - 7ms
C# - 25ms
PHP - 27ms
Perl - 39ms
Node - 60ms
Kari - 211ms
Ruby - 304ms
Python - 930ms
Scheme - 1282ms[/QUOTE]
Any chance you could also test out angelCode, squirrel, gameMonkey and pawn?
Im curious to see how they bare out
[QUOTE=Richy19;31825120]Any chance you could also test out angelCode, squirrel, gameMonkey and pawn?
Im curious to see how they bare out[/QUOTE]
I would like to see Java in addition.
I'm working on a game with destructible terrain, kinda like Clonk.
[img]http://i.imgur.com/QwD2e.jpg[/img]
The map is split into 128x128 tiles
[img]http://i.imgur.com/YbyVy.jpg[/img]
Basically finished this game, though I will probably add a gamemode where you collect blocks instead of dodge them.
[IMG]http://i.imgur.com/6ULv3.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.