[QUOTE=cody8295;34211078]Got bored and made this in a few minutes. Not even nearly close to as cool as r0b0tsquid's, but it's fun to mess around in.[/QUOTE]
It's plotting Bezier curves?
What are you using to draw - is that a built-in component? :)
[editline]14th January 2012[/editline]
Reminds me, I should probably add a "perspective" option to swap between perspective/orthogonal.
Seeing as Codeblocks decided to work for only 50%, is there any way to transfer projects from Codeblocks to Codelite?
[QUOTE=cody8295;34211078]Got bored and made this in a few minutes.[/QUOTE]
"Few minutes" my ass.
[QUOTE=Maurice;34211606]"Few minutes" my ass.[/QUOTE]
Yeah. Only Maurice can work that fast.
[QUOTE=Doohl;34209508]Here's a small Roguelike thing I'm working on using C++ and Libtcod. Graphics may or may not follow once all the other important things have been fully developed.
[IMG]http://dl.dropbox.com/u/10657252/Dev/RoguelikeDev2.PNG[/IMG][/QUOTE]
Is that curses? If so, high-five!
[QUOTE=i300;34212554]Is that curses? If so, high-five![/QUOTE]
[QUOTE=Libtcod]libtcod, a.k.a. “The Doryen Library”, is a free, fast, portable and uncomplicated API for roguelike developpers providing an advanced true color console, input, and lots of other utilities frequently used in roguelikes.[/QUOTE]
I'd assume not. Unless he's using both :v:
I have no clue how to go about identifying objects via color so this may be interesting.
First of all I took this and produced mean, minimum and maximum values of red, green and blue.
[img]http://puu.sh/doZJ[/img]
Then I took whatever fell in the min-max range and got this.
[img]http://puu.sh/doXo[/img]
Well that's just awful.
Then I stopped being silly and took mean rgb values and used a +/- tolerance of 16 to produce this
[img]http://puu.sh/dp2v[/img]
Which isn't half bad.
So I'm wondering if anyone has suggestions as to how produce a better results.
Also If I was content with the second result I'd have to somehow identify the largest matching area which produces a massive 'how?'.
[QUOTE=Ploo;34212794]I have no clue how to go about identifying objects via color so this may be interesting.
First of all I took this and produced mean, minimum and maximum values of red, green and blue.
Then I took whatever fell in the min-max range and got this.
Well that's just awful.
Then I stopped being silly and took mean rgb values and used a +/- tolerance of 16 to produce this
Which isn't half bad.
So I'm wondering if anyone has suggestions as to how produce a better results.
Also If I was content with the second result I'd have to somehow identify the largest matching area which produces a massive 'how?'.[/QUOTE]
If you need precise results, start a bfs on a pink pixel and paint all the connected ones to a different color. Then start on another pink one and do the same storing the amount of them each time. When there are not pink pixels left, you have all the areas and their sizes.
If you don't need that much precision, you could just grid it up and check which grid cell has the most pink pixels.
[QUOTE=Ploo;34212794]I have no clue how to go about identifying objects via color so this may be interesting.
First of all I took this and produced mean, minimum and maximum values of red, green and blue.
[img]http://puu.sh/doZJ[/img]
Then I took whatever fell in the min-max range and got this.
[img]http://puu.sh/doXo[/img]
Well that's just awful.
Then I stopped being silly and took mean rgb values and used a +/- tolerance of 16 to produce this
[img]http://puu.sh/dp2v[/img]
Which isn't half bad.
So I'm wondering if anyone has suggestions as to how produce a better results.
Also If I was content with the second result I'd have to somehow identify the largest matching area which produces a massive 'how?'.[/QUOTE]
A naive method to finding the largest matching area would be a simple flood fill... if that's what you're asking.
[editline]14th January 2012[/editline]
Ninja'd
[editline]14th January 2012[/editline]
So I'm working on a scripting language and what I'm wondering is:
How far in-depth should I get with the VM? Should I keep it's memory as an array of word-sized numbers or should I like abstract it more? I'm not even sure where to begin.
Any suggested reading for virtual machines and/or interpreters?
I'm going to be using a hand-written C lex and parser.
[QUOTE=Jawalt;34212943]
So I'm working on a scripting language and what I'm wondering is:
How far in-depth should I get with the VM? Should I keep it's memory as an array of word-sized numbers or should I like abstract it more? I'm not even sure where to begin.
Any suggested reading for virtual machines and/or interpreters?
I'm going to be using a hand-written C lex and parser.[/QUOTE]
I would use an array of unions or structs to keep metadata about each variable, like whether it's a string or a number.
[code]
struct variable
{
char *name;
union {
int ivalue;
double dvalue;
char * strvalue;
}
}[/code]
[QUOTE=Octave;34214672]I would use an array of unions or structs to keep metadata about each variable, like whether it's a string or a number.[/QUOTE]
In that case you could just use a void * anyway.
[QUOTE=esalaka;34214735]In that case you could just use a void * anyway.[/QUOTE]
ah yes, the mysterious void pointer
well, I got 1 month ahead of me with lots and lots of free time, working on an Isometric game engine
here I'm testing A* with a typical nazi zombie scenario ;p
enjoy
[video=youtube;NIzHMH7vOOE]http://www.youtube.com/watch?v=NIzHMH7vOOE[/video]
btw my horrible win 7 mobile phone game got accepted with my first try *shocked*
[url]http://www.windowsphone.com/de-CH/apps/d9cdf783-da69-49a0-9238-46d19509aeb2[/url]
for free, thus you waste nothing else than a few seconds of installing, testing, hating and removing it (in this order) ;p
[QUOTE=Octave;34214781]ah yes, the mysterious void pointer[/QUOTE]
It's just a pointer to anything.
Nothing mysterious there.
I was working on LuaCraft (new name heh) again and we are at 1.1! :v:
[img]http://img.luastoned.com/luacraft_update_v1.png[/img]
[img]http://img.luastoned.com/luacraft_server_updater_v1.png[/img]
It now installs / updates via this updater: [url]http://luacraft.com/Server_Updater.jar[/url]
Wiki got moved to [url]http://wiki.luacraft.com[/url]
Plus we got a forum at [url]http://forum.luacraft.com[/url]
€dit:
I made an automated build bot (for nightly builds) too:
[code]
//////////////////////////////////////////////////
// LuaCraft - Client Build
// * Mercurial Pull & Update
// * Building Config
// * Compiling
// * Include additional files
// * Create .jar file
// * Obfuscate .jar file
// * Unpacking .class files for updater
// * Generating MD5 hashes
// * Finished~
//////////////////////////////////////////////////
[/code]
Now we just update code & push it to our repo, clients will get informed about an update too!
Currently working on one of those endless running games where you have to avoid obstacles and such but I also wanted to add my own touch of shooting and violence.
Here's a video of current gameplay (Youtube crapped all over the quality)
[media]http://www.youtube.com/watch?v=kcJD9bu46zg[/media]
Download link in the video description if you want to try your hand at it.
Or here
[url]http://www.mediafire.com/?7lfj9y763p05y8j[/url]
Alright so I've decided for my language to be stack-oriented. Here's an example:
C code to hash "hello", this isn't supposed to be a cryptohash, just a hash. Stole it from online.
[code]
#include "stdio.h"
unsigned long hash(unsigned char *str)
{
unsigned long hash = 5381;
int c;
while (c = *str++)
hash = ((hash << 5) + hash) + c;
return hash;
}
int main(int argc, char **argv)
{
unsigned long hashed = hash("hello");
printf("%lu ", hashed);
}
[/code]
How it'd look in what I want to do:
[code]
main
{
0 104 101 108 108 111
hash
print
}
hash
{
5381 swap
0 != while
{
pop pop swap dup
5 << + +
swap
0 !=
}
}
[/code]
And with comments:
[code]
main -- entry point
{
0 104 101 108 108 111 -- Push "hello" to the stack with a 0 at the end to end the string.
hash -- Pushes current memory adress to 'instruction stack' and jumps to the new function location.
print
}
hash
{
5381 swap -- Push 5381 to the stack, then swap it with the one before.
0 != -- We push 0 to the stack and then check for inequality, pushing 1 or 0 to the stack.
while -- Keep executing this code until the top of the stack == 0
{
pop
pop -- Pop the last two numbers off the stack.
swap dup -- bring the hash 'variable' to the top of the stack.
5 << -- shift by 5
+ -- Add the earlier copy of the hash.
+ -- Finally add the character value.
swap -- Put the next character on the top of the stack.
0 != -- Compare, if it fails the while ends and the function returns.
}
}
[/code]
Heavy inspiration from Forth and the like. Now time to get implementing!
[img]http://img.luastoned.com/luacraft_v1.png[/img]
I'm done for today, it is 3am .___.
When I read "LuaCraft" I thought of [url]http://sourceforge.net/projects/luacraft/[/url], but this actually looks pretty interesting.
Short video showing off the progress of MD. I haven't worked on it in a while. I should.
[media]http://www.youtube.com/watch?v=sN9TBqYM2Vk[/media]
[QUOTE=Yogurt;34217819]Short video showing off the progress of MD. I haven't worked on it in a while. I should.
[media]http://www.youtube.com/watch?v=sN9TBqYM2Vk[/media][/QUOTE]
"Physics are really broken. So, hats are nice."
[QUOTE=Jawalt;34217947]"Physics are really broken. So, hats are nice."[/QUOTE]
They are nice.
[QUOTE=Jawalt;34215517]Alright so I've decided for my language to be stack-oriented. Here's an example:
C code to hash "hello", this isn't supposed to be a cryptohash, just a hash. Stole it from online.
[code]
#include "stdio.h"
unsigned long hash(unsigned char *str)
{
unsigned long hash = 5381;
int c;
while (c = *str++)
hash = ((hash << 5) + hash) + c;
return hash;
}
int main(int argc, char **argv)
{
unsigned long hashed = hash("hello");
printf("%lu ", hashed);
}
[/code]
How it'd look in what I want to do:
[code]
main
{
0 104 101 108 108 111
hash
print
}
hash
{
5381 swap
0 != while
{
pop pop swap dup
5 << + +
swap
0 !=
}
}
[/code]
And with comments:
[code]
main -- entry point
{
0 104 101 108 108 111 -- Push "hello" to the stack with a 0 at the end to end the string.
hash -- Pushes current memory adress to 'instruction stack' and jumps to the new function location.
print
}
hash
{
5381 swap -- Push 5381 to the stack, then swap it with the one before.
0 != -- We push 0 to the stack and then check for inequality, pushing 1 or 0 to the stack.
while -- Keep executing this code until the top of the stack == 0
{
pop
pop -- Pop the last two numbers off the stack.
swap dup -- bring the hash 'variable' to the top of the stack.
5 << -- shift by 5
+ -- Add the earlier copy of the hash.
+ -- Finally add the character value.
swap -- Put the next character on the top of the stack.
0 != -- Compare, if it fails the while ends and the function returns.
}
}
[/code]
Heavy inspiration from Forth and the like. Now time to get implementing![/QUOTE]
looks like reverse-kari
[editline]15th January 2012[/editline]
[QUOTE=esalaka;34215084]It's just a pointer to anything.
Nothing mysterious there.[/QUOTE]
isn't it technically a pointer to nothing?
[editline]15th January 2012[/editline]
[QUOTE=ROBO_DONUT;34207570]I think he means the whole currying thing. Functions building functions that build other functions, etc.[/QUOTE]
And because it's dynamically typed, you have no idea if a function is going to return another function or another value!
[QUOTE=Yogurt;34217819]Short video showing off the progress of MD. I haven't worked on it in a while. I should.
[media]http://www.youtube.com/watch?v=sN9TBqYM2Vk[/media][/QUOTE]
I feel like this should end up more then a terraria/minecraft clone becuase everything seems really neat, it just feels like it has more potential.
[QUOTE=swift and shift;34218278]isn't it technically a pointer to nothing?[/QUOTE]
void * is just a pointer, it can be to any data type
[QUOTE=Garb;34218315]I feel like this should end up more then a terraria/minecraft clone becuase everything seems really neat, it just feels like it has more potential.[/QUOTE]
[url=http://www.facepunch.com/threads/1137875]It is going to be much more. [/url]
[QUOTE=amcfaggot;34218335]void * is just a pointer, it can be to any data type[/QUOTE]
yeah, but 'void' itself is nothing. You can't dereference void* because then you'd have nothing
[QUOTE=swift and shift;34218383]yeah, but 'void' itself is nothing. You can't dereference void* because then you'd have nothing[/QUOTE]
I don't think 'void *' refers to the idea of nothing like it does when you use it in the context of a function definition, I think it's just a placeholder to tell that it's a pointer to some type of data.
[QUOTE=swift and shift;34218383]yeah, but 'void' itself is nothing. You can't dereference void* because then you'd have nothing[/QUOTE]
sure, but you can always cast it to use it. without casting it you don't know much about it
[editline]14th January 2012[/editline]
[QUOTE=Octave;34218411]I don't think 'void *' refers to the idea of nothing like it does when you use it in the context of a function definition, I think it's just a placeholder to tell that it's a pointer to some type of data.[/QUOTE]
yes.
Writing my lexer and parser in Lua first, then porting to C. The interpreter itself will be written in C from the beginning.
It's so much easier to plan out flow and manipulate strings in a scripting language. And I am able to 'think' much easier in Lua, so writing it in Lua and then rewriting it in C with the same flow is a lot easier than just starting with C.
Sorry, you need to Log In to post a reply to this thread.