[QUOTE=TheEyes;50096875]For your final improvement, make it non-JS based.[/QUOTE]
Javascript is awesome.
[vid]https://i.gyazo.com/623e32d6667cef6ac9b0ccb48f0b7fb5.mp4[/vid]
Progress: more realistic watermelon physics, better looking breaking. Next up: the artist is making actual art and I'm making a physics-simulated duck neck :cool:
[QUOTE=DoctorSalt;50101386]Ultimate goal is to have by webCrawler subclass serialize local data when java shuts down/exception happens so we can recover it on reset. Massive pain since we pass the class name to a crawling library which creates and manages it, so I don't know if I can use that Try With Resources thing.
Thanks though for your help.[/QUOTE]
Well, you can set the global exception handler iirc so you can save in there as well as a clean exit.
PBR-like setup in a 2D engine? Sounds like madness:
[img]http://puu.sh/ocnBT.jpg[/img]
That is fucking awesome! Keep it up, looks like crazy money maker to me.
[QUOTE=fewes;50101927]PBR-like setup in a 2D engine? Sounds like madness:
[img]http://puu.sh/ocnBT.jpg[/img][/QUOTE]
The way you are going it will end up being a 3D engine. First it was 2D, then 2.5D, now it's somewhere around 2.8D.
2d engines with features that usually seem overkill are good, look at ubiart
[QUOTE=AntonioR;50102085]The way you are going it will end up being a 3D engine. First it was 2D, then 2.5D, now it's somewhere around 2.8D.[/QUOTE]
yeah it is convergin to 3D, so it will be 2.999D soon
I've been so busy lately I honestly haven't had much time to program. Finally got some time today to sit down and write something.
[url]https://github.com/Sidneys1/SimpleArgv[/url]
Basically it's a really naïve command-line argument parser for my C# projects :v:
It's not much, but it's [I]my[/I] not much.
I've also been getting my own GitLab/apache server set up on a Raspberry PI 2 using HAproxy to redirect subdomains. GitLab is a bitch to configure the ports of. :( It currently *works*, but the GitLab clone URL ends in the incorrect port (the internal port, not the external)
I was extracting textures from an old game, and needed an algorithm to pack many small textures into a texture atlas. I found a very nicely explained algorithm on this page and wanted to share, if someone might need something like this:
[url]http://www.blackpawn.com/texts/lightmaps/default.html[/url]
The packing algorithm is so simple, I didn't think it would work. You just create a node with the output texture size and loop trough your images and call Insert() with individual texture's width and height. The node recursively splits itself if its size doesn't match the input, and calls Insert() of the child nodes. The node that gets returned holds the final [x,y] position, and if it returns NULL it means the image couldn't fit. The grey lines mark individual textures and animations that I grouped together in code, so it doesn't all get mixed, but that is another story.
[img]http://i.imgur.com/arxjKV1.png[/img]
Here is my implementation in C++ to spare you 2 minutes of converting the pseudocode:
[quote][code]
#include <vector>
class AR_Node
{
public:
std::vector<AR_Node> child; //child nodes
int x, y, w, h; //position and node size
bool image; //image stored in the node
AR_Node* Insert(int img_w, int img_h);
AR_Node()
{
this->x = y = w = h = 0;
this->image = false;
}
};
AR_Node* AR_Node::Insert(int img_w, int img_h)
{
//if we are not a leaf then
if(!this->child.empty())
{
//try inserting into first child
AR_Node *newNode = this->child[0].Insert(img_w,img_h);
if(newNode!=NULL) return newNode;
//no room in first child, insert into second
return this->child[1].Insert(img_w,img_h);
}
else
{
//if there is already a image here, return
if(this->image) return NULL;
//if image doesn't fit, return
if(this->w<img_w || this->h<img_h) return NULL;
//if we're just right, accept
if(this->w==img_w && this->h==img_h)
{
this->image = true;
return this;
}
//otherwise split this node and create some children
this->child.push_back(AR_Node());
this->child.push_back(AR_Node());
//decide which way to split
int dw = this->w - img_w;
int dh = this->h - img_h;
if(dw>dh)
{
//vertical split
//left
this->child[0].x = this->x;
this->child[0].y = this->y;
this->child[0].w = img_w;
this->child[0].h = this->h;
//right
this->child[1].x = this->x + img_w;
this->child[1].y = this->y;
this->child[1].w = this->w - img_w;
this->child[1].h = this->h;
}
else
{
//horizontal split
//up
this->child[0].x = this->x;
this->child[0].y = this->y;
this->child[0].w = this->w;
this->child[0].h = img_h;
//down
this->child[1].x = this->x;
this->child[1].y = this->y + img_h;
this->child[1].w = this->w;
this->child[1].h = this->h - img_h;
}
//insert into first child we created
return this->child[0].Insert(img_w,img_h);
}
}[/code][/quote]
There are some other interesting articles from the same guy here:
[url]http://www.blackpawn.com/blog/texts/[/url]
I use a similar algo for my font atlases.
[QUOTE=fewes;50101927]PBR-like setup in a 2D engine? Sounds like madness:
[img]http://puu.sh/ocnBT.jpg[/img][/QUOTE]
could you do me a favor and tell me how you learn how to do this shit
I want to make a top-down game, and I would love to learn how to do something like this
[QUOTE=Ac!dL3ak;50103628]could you do me a favor and tell me how you learn how to do this shit
I want to make a top-down game, and I would love to learn how to do something like this[/QUOTE]
Advice: if you just want to make a game, just use an engine like Unity or GameMaker.
You COULD build a whole rendering engine but it's about a year's worth of part time work and you could get the same results with a few afternoons of tutorials for a pre-existing engine.
Got really high yesterday. Picked up LOVE2D. Decided to make a showdown clone.
All I've really implemented is a console and a basic server/client setup.... not sure if I should start on UI or client messages.
Server:
[img]http://i.imgur.com/mvTvzQJl.png[/img]
Client:
[img]http://i.imgur.com/PmV5dHll.png[/img]
Also, is sending Lua code over the socket a good idea? Like, I feel like it's safe if you sandbox the code enough...
[QUOTE=chimitos;50103686]Advice: if you just want to make a game, just use an engine like Unity or GameMaker.
You COULD build a whole rendering engine but it's about a year's worth of part time work and you could get the same results with a few afternoons of tutorials for a pre-existing engine.[/QUOTE]
And I agree; however, that doesn't mean I don't want to play around with these concepts.
Okay so I'm assuming the disagrees I'm getting on my post are in response to my asking if sending Lua code over a socket is a bad idea.
Why?
Like, I'd understand if it was another language, but you can sandbox the shit out of Lua code, you could metatable the environment such that the only things that are exposed are client/server stuff. It would be [i]soooo[/i] much easier than having to deal with parsing/encoding/decoding.
[QUOTE=cheesylard;50104103]Okay so I'm assuming the disagrees I'm getting on my post are in response to my asking if sending Lua code over a socket is a bad idea.
Why?
Like, I'd understand if it was another language, but you can sandbox the shit out of Lua code, you could metatable the environment such that the only things that are exposed are client/server stuff. It would be [i]soooo[/i] much easier than having to deal with parsing/encoding/decoding.[/QUOTE]
It's just generally a Bad Idea(tm). Parsing/encoding/decoding tends to be much safer than directly executing code, and in most cases can't easily perform a DoS attack, unlike actual code ([i]while(1)[/i], anyone?).
Improving my lexer. gonna read philosophy books and papers and see if I can fake philosophy papers. Maybe going to make a paragraph of fake philosophy next to real philosophy and see if people can distinguish it
I managed to create a FPS camera in Godot.
I also discovered that Godot does not use either semicolons or curly brackets. I know from now my code's gonna be completely unreadable.
[QUOTE=Ac!dL3ak;50103628]could you do me a favor and tell me how you learn how to do this shit[/QUOTE]
- Study math, lots of linear algebra, geometry, maybe some calculus (integrals and shit)
- Study shaders (vertex/fragment)
- Write code and experiment, first day it's triangle, next week it's diffuse sprite and so on..
[QUOTE=Fourier;50104591]- Study math, lots of linear algebra, geometry, maybe some calculus (integrals and shit)
- Study shaders (vertex/fragment)
- Write code and experiment, first day it's triangle, next week it's diffuse sprite and so on..[/QUOTE]
you don't even need to "study" math really, if you look at existing code you'll figure it out pretty quickly if you put your mind into it
[editline]10th April 2016[/editline]
that sort of counts as studying doesn't it though
[editline]10th April 2016[/editline]
what i meant is that you don't need to read a ton of books about it, i've read literally none and i'm good
[QUOTE=DarKSunrise;50104643]you don't even need to "study" math really, if you look at existing code you'll figure it out pretty quickly if you put your mind into it
[editline]10th April 2016[/editline]
that sort of counts as studying doesn't it though
[editline]10th April 2016[/editline]
what i meant is that you don't need to read a ton of books about it, i've read literally none and i'm good[/QUOTE]
Same, I'm happily moving into graphics engineering, a very math-heavy field, and I've never studied mathematics.
We wrote very cheap (vertex based) height shader, which is also vertex lit. So cheap even old mobile phones will be able to run this game.
[IMG]http://i.imgur.com/KoSFZUN.jpg[/IMG]
[QUOTE=DarKSunrise;50104643]you don't even need to "study" math really, if you look at existing code you'll figure it out pretty quickly if you put your mind into it
[editline]10th April 2016[/editline]
that sort of counts as studying doesn't it though
[editline]10th April 2016[/editline]
what i meant is that you don't need to read a ton of books about it, i've read literally none and i'm good[/QUOTE]
Unless you are sauce of genius, you need to know some theory behind shaders, at least about vectors, matrices and dot products. Yes, it's possible to play with code and figure stuff out, that way I learned 2D math and it's easy, but 3D is a bit tougher. Seriously, you can't go without math when dealing with shaders, since it's all geometry and geometry is math.
[QUOTE=Ac!dL3ak;50103628]could you do me a favor and tell me how you learn how to do this shit
I want to make a top-down game, and I would love to learn how to do something like this[/QUOTE]
Disregarding C++ knowledge it's a mix between working as a 3D modeler for some years, having had an interest for 3D rendering theory for a long time and this being my third attempt at an engine made with SFML :v:
First-off, this is very true:
[QUOTE=chimitos;50103686]Advice: if you just want to make a game, just use an engine like Unity or GameMaker.
You COULD build a whole rendering engine but it's about a year's worth of part time work and you could get the same results with a few afternoons of tutorials for a pre-existing engine.[/QUOTE]
That said, if you're looking for a quick and thorough way into SFML I'd recommend [URL="http://www.amazon.co.uk/SFML-Game-Development-Jan-Haller/dp/1849696845/"]this book[/URL] (covers pretty much every aspect of the library (plus has a lot of engine design theory in it) and is reasonably up to date, although there might be newer options that I don't know of).
If you're interested in understanding physcally based rendering specifically I'd recommend giving [URL="https://docs.google.com/document/d/1Fb9_KgCo0noxROKN4iT8ntTbx913e-t4Wc2nMRWPzNk/edit"]this Google Doc[/URL] a read.
If you're interested in learning how to write shaders I'd recommend getting started with SFML to the point where you can load custom shaders and just go nuts experimenting. If you'd like to get started right away though I'm sure something like Shadertoy would be useful as well.
[editline]10th April 2016[/editline]
Also here's a lighting update where the lowest mip of the reflection texture is used for IBL:
[img]http://puu.sh/ocVm6.jpg[/img]
[IMG]http://i.imgur.com/usOHurY.png[/IMG]
so I finished implementing steam openID auth for my API but I needed a way to send over the steamID and token from browser to the desktop application. I settled on just starting a websocket server for a few seconds from the desktop application and having the browser send the data to the server when the page loads.
as long as I have https on my server and a secure websocket connection it should be okay right?
After struggling with real-life bix and implementing a command interpreter pattern for my application. I've finally finished it!
[IMG]http://i.imgur.com/pMKzoFX.gif[/IMG]
In this implementation I can define commands through a macro:
[code]
// meanwhile in a file called "command_defines.h"
bool change_clear_color(unsigned argc, String args[])
{
if (argc < 3 || !args)
return false;
float red = (float)atof((const char*)args[0]);
float green = (float)atof((const char*)args[1]);
float blue = (float)atof((const char*)args[2]);
glClearColor(red,green,blue,1);
return true;
}
DEFINE_COMMAND(clear_color, change_clear_color, "Changes the clearing color in OGL context\n");
...
//meanwhile in a filed called "command_base.h"
class __define_command
{
private:
void register_cmd(ConsoleCommand cmd)
{
CommandRegistery::register_command(cmd);
}
public:
__define_command(ConsoleCommand cmd)
{
register_cmd(cmd);
};
};
// ConsoleCommand is a typedef of a ConsoleCommand_T pointer (typedef ConsoleCommand_T* ConsoleCommand)
#define DEFINE_COMMAND(command_name, function_name, help_text) __define_command command_name##_cmd = __define_command(new ConsoleCommand_T(#command_name, function_name, help_text))
[/code]
The "command_defines.h" file is included in the main.cpp file, and the magic is they are defined [I]before[/I] main() is called.
[QUOTE=Fourier;50104591]- Study math, lots of linear algebra, geometry, maybe some calculus (integrals and shit)
- Study shaders (vertex/fragment)
- Write code and experiment, first day it's triangle, next week it's diffuse sprite and so on..[/QUOTE]
You don't need calculus :P
I took a linear algebra course and it listed computer graphics as an application of it. Wrote a thing on it at the end of the class, actually.
It's not that hard once you grok it. Before that point it's kinda annoying though.
[QUOTE=ECrownofFire;50105661]You don't need calculus :P
I took a linear algebra course and it listed computer graphics as an application of it. Wrote a thing on it at the end of the class, actually.
It's not that hard once you grok it. Before that point it's kinda annoying though.[/QUOTE]
Depends really, advanced shader techniques need calculus.. derivatives, integrals, trigonometry, jacobian matrix and so on.
Of course it's all learnable @ home in front of computer.
[QUOTE=ECrownofFire;50105661]You don't need calculus :P
I took a linear algebra course and it listed computer graphics as an application of it. Wrote a thing on it at the end of the class, actually.
It's not that hard once you grok it. Before that point it's kinda annoying though.[/QUOTE]
Linear algebra is the basic, yes, but I'd disagree with you. Math is useful and expands an amazing toolset. When you learn calculus properly everything just makes so much fucking sense.
Made something top-down ww2-ish
[vid]http://webm.land/media/bj8J.webm[/vid]
Sorry, you need to Log In to post a reply to this thread.