• What Are You Working On? September 2015
    1,261 replies, posted
[QUOTE=Tommyx50;48784592]You could do it the same way fully 3d games do it, by utilizing a pixel depth buffer: At the start of each frame, clear a depth buffer to all lowest values. Before drawing a pixel on the screen buffer, first check if the entity's z-value (distance from the camera, screen depth or y position in an isometric game) is higher than the existing pixel's position on the depth buffer. If it is, then draw that pixel to the screen buffer and then draw the another pixel in the same position to the depth buffer, but instead of setting the pixel to a colour you set it to the z-value. If it isn't, you skip drawing that pixel entirely. This technique avoids needing to perform any kind of sorting. If you want to do the simpler technique and just sort instead (also known as the painter's algorithm), it should work as long as your entities are relatively consistent in their z-value. You can then use a sorting algorithm which abuses the temporal and spacial homogenity of your entities z-value - for example heapsort, or even insertion sort if you can guarantee that your data will almost always be mostly sorted and thus can avoid the O(n²) worst case.[/QUOTE] My game is built around html canvas, as such I am unfortunately not using webgl. Not like it's a big deal, I don't understand shaders and mordern opengl. :v:
Implemented function pointers for built in functions of my interpreter! It was actually pretty easy, I just had to throw in another member of the struct (function ptr), and add an argument to my hash functions. for some reason sin(3.14159) yields 2.6535898e-06 what up yo? [editline]29th September 2015[/editline] also cos(3.14159/2) yields 1.3267949e-06
[QUOTE=Berkin;48785004]Even though it may be saved as one channel, your parser could be splitting it up into multiple channels. That would explain the "layers" of color, because as the depth increases, digits carry over and cause a sudden shift in the color you see here. Be sure to check the color channel format you're parsing into.[/QUOTE] I'm parsing into an rgb32 format, as this library doesn't give me strictly a red, green, or blue as an image input format. I guess I'm just going to have to merge the 3 values of every pixel and then set that uniformly as the rgb value.
[QUOTE=proboardslol;48785115]Implemented function pointers for built in functions of my interpreter! It was actually pretty easy, I just had to throw in another member of the struct (function ptr), and add an argument to my hash functions. for some reason sin(3.14159) yields 2.6535898e-06 what up yo? [editline]29th September 2015[/editline] also cos(3.14159/2) yields 1.3267949e-06[/QUOTE] Those results are ok. They are very near zero. Maybe if you would input more precise π, then you would get better result.
I rewrote the color mixer and made it significantly better. I now have a list of base colors separate from the filters, which are mixed with a mean average. Filter/base combos give much more convincing outputs. "grey grey grey" just yields grey instead of white. And red-green is no longer yellow. [img]http://i.imgur.com/ZDVF433.png[/img] Oh and by the way, you can find the list of keywords in the code [URL="https://github.com/TheBerkin/theberkin.github.io/blob/master/static/js/incantate.js"]here[/URL]. Enjoy.
[QUOTE=false prophet;48785050]My game is built around html canvas, as such I am unfortunately not using webgl. Not like it's a big deal, I don't understand shaders and mordern opengl. :v:[/QUOTE] Then I wouldn't worry about time complexity too much
I'm working on a UI tool that allows non-programmers to design an UI, export it to a file and import it to their game engine (going to write implementations for Unreal, Unity, etc). The things I want to have covered in the system / tool are basically the following things: - Element position, size, margin, padding, background, color, scale, effects (such as scale over time etc) - Menu "views", so that multiple views can be created and later linked together by a programmer - An interface for programmers to use, so that all parameters of all elements can be updated - A JavaScript like event system to make the menu functional. Example: [code] UI.on(UI_CLICK, "StartButton", [this]() { gameStarted = true; }); [/code] And last, I want to have the ability to modify the UI over LAN. This could be useful in playtesting sessions, so that when a designer is getting feedback about an element being counter-intuitive or blocking something of the screen, another computer can be used to move that element to another position, so that the game won't have to be recompiled as a new build just to work with the feedback during a playtest session. If this is done, I hope I have something this easy to use that it I can sell it in asset stores.
[QUOTE=awcmon;48782650]did more work on my c++ site generator thingy because for some odd reason i thought this would be a good idea it can automatically add certain things to all pages in the site among other things. I use this for things like navbars because im both too lazy to copy and paste the navbar on every page and too lazy to learn how to use a templating engine or something input: [code] int main() { Site website("Awcmon.github.io"); {//Generate index Page index("index"); Element hello("h1", "", "hi im awcmon"); Element desc("p", "", "i used to write c++ and make a lot of people angry but i cant anymore so here's a website bye"); Element jumbotron("div", "class = \"jumbotron\""); Element jumbotroncontainer("div", "class = \"container\""); jumbotroncontainer.addElement(hello); jumbotroncontainer.addElement(desc); jumbotron.addElement(jumbotroncontainer); index.addElement(jumbotron); website.addPage(index); } {//Generate about page Page about("about"); Element hello("h1", "", "about this site"); Element desc("p", "", "i wrote this site in c++ rofl"); Element jumbotron("div", "class = \"jumbotron\""); Element jumbotroncontainer("div", "class = \"container\""); jumbotroncontainer.addElement(hello); jumbotroncontainer.addElement(desc); jumbotron.addElement(jumbotroncontainer); about.addElement(jumbotron); website.addPage(about); } {//Generate projects page Page projects("projects"); Element hello("h1", "", "projects"); Element desc("p", "", "some projects"); Element jumbotron("div", "class = \"jumbotron\""); Element jumbotroncontainer("div", "class = \"container\""); jumbotroncontainer.addElement(hello); jumbotroncontainer.addElement(desc); jumbotron.addElement(jumbotroncontainer); projects.addElement(jumbotron); website.addPage(projects); } //Generate common elements SiteManager sitemanager(website); Element title("title", "", "Hello World!"); sitemanager.addCommonHead(title); Element bootstrap("link", "rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\""); sitemanager.addCommonHead(bootstrap); Element maincss("link", "rel=\"stylesheet\" href=\"main.css\""); sitemanager.addCommonHead(maincss); Element navlist("ul", "class=\"pull-right\""); std::vector< std::array<std::string,2> > navbarButtons; navbarButtons.push_back({ "Main", "index.html" }); navbarButtons.push_back({ "About", "about.html" }); navbarButtons.push_back({ "Projects", "projects.html" }); for (int i = 0; i < (int)navbarButtons.size(); i++) { Element item("li"); item.addElement(Element("a", "href=\"" + navbarButtons[i][1] + "\"", navbarButtons[i][0])); navlist.addElement(item); } Element logo("img", "src=\"namcwologo.png\" class=\"pull-left\" alt=\"logo\" width=\"230\" height=\"28\" style=\"PADDING-TOP:5px;PADDING-RIGHT:5px;\""); Element logoLink("a", "href=\"index.html\""); logoLink.addElement(logo); Element navbar("div", "class=\"nav\""); Element navcontainer("div", "class=\"container\""); navcontainer.addElement(navlist); navbar.addElement(navcontainer); sitemanager.addCommonBodyHead(logoLink); sitemanager.addCommonBodyHead(navbar); GenerateHTML(sitemanager.bake()); return 0; } [/code] output: [url]http://awcmon.github.io/index.html[/url] i plan to make a gui designer and shit for this so i dont have to write c++ to generate a website anymore [editline]28th September 2015[/editline] disclaimer: im a complete noob to webdev entirely[/QUOTE] I was thinking, perhaps you can use init lists here, so I tried: [url]https://gist.github.com/KateAdams/c7ea0b1b61a1b256a14e[/url] [code] ... int main(int argc, char** argv) { if(argc <= 2) return 1; std::string whom = argv[1]; std::string where = argv[2]; std::string html = cpp2html::cpp2html({ {"html", {}, { {"head", {}, { {"title", {}, { {"Hello, " + whom + "!"} }} }}, {"body", {}, { {"p", {}, { {"Hello, "}, {"a", {{"href", where}}, { {whom + "!"} }} }} }} }} }); std::cout << html << "\n"; return 0; } [/code] [code] $ ./main Garry /newman <html> <head> <title> Hello, Garry! </title> </head> <body> <p> Hello, <a href="/newman"> Garry! </a> </p> </body> </html> [/code] Doesn't do any HTML escaping, but that's not difficult anyway—just throw in a URL escape (replacing out of band chars with %XX) for the attributes, and a HTML escape (change few 'special' chars to &name; or &codepoint;) in the element(const std::string&) constructor.
Worked on engine sounds last night. There's a ship rumble that's always playing and a thruster sound based on the engine's throttle. There's really not that much going on, but it's nice to finally have the game not be completely silent except for shooting. I'm not really sure how else to expand the engine sounds. It seems like such a simple soundscape for engines and I want to do more but nothing is coming to mind. [vid]https://dl.dropboxusercontent.com/u/15133164/Capital/Unity%202015-09-28%2023-46-45-01.webm[/vid]
[QUOTE=Why485;48787215]Worked on engine sounds last night. There's a ship rumble that's always playing and a thruster sound based on the engine's throttle. There's really not that much going on, but it's nice to finally have the game not be completely silent except for shooting. I'm not really sure how else to expand the engine sounds. It seems like such a simple soundscape for engines and I want to do more but nothing is coming to mind.[/QUOTE] Honestly the sound is really good, don't worry about it! [editline]29th September 2015[/editline] PS: The effects and atmosphere you have going already are captivating, so you're really on to something!
[QUOTE=COBRAa;48785738]I was thinking, perhaps you can use init lists here, so I tried: [url]https://gist.github.com/KateAdams/c7ea0b1b61a1b256a14e[/url] [/QUOTE] I made my c++ to html thingy intending to make a sort of GUI editor where I can just create new elements and push and pop em around so while it doesnt make for elegant looking c++ code when i hardcode a website, it makes it easier for me to make a sort of editor thing (since i dont want to be hardcoding anything towards the end hopefully) prob since i have no idea what init lists are or how they work
I'm really happy, after reading some horror stories here of computer science courses requiring a specific coding style, or limiting the features you could used until they had been taught, today was a nice surprise. You are encouraged to use TDD, but other than that, I am allowed to use anything in the language, with no specific coding style, though spaces are also preferred over tabs it seems (already switched to that a while ago though). The tasks are dull though.
[img]http://i.imgur.com/YoK94NL.png[/img] Simple tile engine in JSFML. I like it better than in C++ cause it didn't take me an hour to set up the libraries and IDE.
[QUOTE=ben1066;48789593]I'm really happy, after reading some horror stories here of computer science courses requiring a specific coding style, or limiting the features you could used until they had been taught, today was a nice surprise. You are encouraged to use TDD, but other than that, I am allowed to use anything in the language, with no specific coding style, though spaces are also preferred over tabs it seems (already switched to that a while ago though). The tasks are dull though.[/QUOTE] I just got into a Java course at my school and while the teacher requires BlueJ, she let me use Eclipse, only requiring that I check if the code compiles with BlueJ. She also has those online quizzes with preset answers and the first quiz I did for it, a practice one, it marked an answer wrong because I typed something like ( args ) instead of (args). Other than that, it's fairly nice, but also rather boring at the moment, since I know most of this.
[QUOTE=HumbleTH;48789882]I just got into a Java course at my school and while the teacher requires BlueJ, she let me use Eclipse, only requiring that I check if the code compiles with BlueJ. She also has those online quizzes with preset answers and the first quiz I did for it, a practice one, it marked an answer wrong because I typed something like ( args ) instead of (args). Other than that, it's fairly nice, but also rather boring at the moment, since I know most of this.[/QUOTE] For my C unit at least, it has to be valid C99 that will run correctly on a CentOS 7 machine, but that's a pretty easy target. No "quizzes" either, tests to pass however.
[QUOTE=HumbleTH;48789882]I just got into a Java course at my school and while the teacher requires BlueJ, she let me use Eclipse, only requiring that I check if the code compiles with BlueJ. She also has those online quizzes with preset answers and the first quiz I did for it, a practice one, it marked an answer wrong because I typed something like ( args ) instead of (args). Other than that, it's fairly nice, but also rather boring at the moment, since I know most of this.[/QUOTE] Blue J???? (checks country) oooh okay
[QUOTE=proboardslol;48790089]Blue J???? (checks country) oooh okay[/QUOTE] It's an american school.
[QUOTE=proboardslol;48790089]Blue J???? (checks country) oooh okay[/QUOTE] I used BlueJ in AP Comp Sci in High School. I know New Media Design students here at RIT use BlueJ for a semester as well.
[QUOTE=MadPro119;48790201]I used BlueJ in AP Comp Sci in High School. I know New Media Design students here at RIT use BlueJ for a semester as well.[/QUOTE] My highschool used greenfoot. It was pretty fun but looking back now my code was absolutely horrible. Definitely would've failed out using the same practices. Basically I made one class for every object, and just called them "Enemy1", "Enemy2", etc.
SNIP. Mixed up tabs with MGS thread.
Been working on my irc bot Nimdok's rewrite a bit more. He supports models and the core idea is that it's a modular bot. So the admin management is a model on it's own that has a decorator that can be used. A good example: [url]https://github.com/Mechazawa/Nimdok/blob/master/nimdok/modules/eval.py[/url] Colors are also pretty neat since it just hooks into the existing python format method. [url]https://github.com/Mechazawa/Nimdok/blob/master/nimdok/core/color.py[/url] I know showing an irc bot isn't as much fun as a game or something but it's still neat. [t]http://i.imgur.com/lcD7hhT.png[/t]
I added some smooth button presses. [img]http://zippy.gfycat.com/OrneryPastelAsianwaterbuffalo.gif[/img] It came out surprisingly clean, too: [cpp] void PressImpl::Tick(Control& c, float dt) { IwAssertMsg(UI, &c == Ctrl, ("Press behavior can only Tick() on the same control that it was Run() on!")); bool hasTouchDown = Ctrl->HasTouchDown(); if (hasTouchDown != HadTouch) { float to = hasTouchDown ? 0.8f : 1.0f; delete Lerper; Lerper = new ConcreteLerper<float>(Ctrl->Scale, Ctrl->Scale, to, 0.1f); HadTouch = hasTouchDown; } if (Lerper != NULL) { Lerper->Tick(dt); } } [/cpp] [editline]30th September 2015[/editline] On a separate note, looks like we can't use gfycat with vid tags? What do you guys use for hosting?
[QUOTE=icantread49;48790939]On a separate note, looks like we can't use gfycat with vid tags? What do you guys use for hosting?[/QUOTE] For vid tags to work, you need to use the video. So you take the .webm version of your upload. [vid]http://zippy.gfycat.com/OrneryPastelAsianwaterbuffalo.webm[/vid] Click reply on my post so you can see what I did.
[IMG]https://i.gyazo.com/9dda84942220e24e02808c65860e8742.png[/IMG] first time making a sprite that isnt a box for a player.
Once I get a break from schoolwork, I will be writing up a brief specification for the library concept that I mentioned a few pages back. I wasn't kidding when I said it involves linguistics, parameter automation, and pure motherfucking magic. I'm not sure what it could be used for yet, but I think it's really cool, so I look forward to getting some community feedback to potentially turn it into something useful. Stay tuned. Also, it looks like I'll be making a new thread in the next day or so. Wow, so soon?
[IMG]http://i.imgur.com/FOs2BKC.png[/IMG] Java Stringes update! Lexer and StringeReader classes are done I guess, managed to get the lexer demo working kinda. I don't have VS installed so I don't know what the original version does, but I'm preeeetty sure the numbers should all be one token :v: EDIT: Whoops, fixed. Missed a "!" in eatWhile()
I like doing pixelated little people [url]http://imgur.com/a/n6Qhy[/url] [url]http://imgur.com/a/eUoSb[/url] might wanna open these in like photoshop to get a good zoom in
[QUOTE=proboardslol;48790253]My highschool used greenfoot. It was pretty fun but looking back now my code was absolutely horrible. Definitely would've failed out using the same practices. Basically I made one class for every object, and just called them "Enemy1", "Enemy2", etc.[/QUOTE] My AP computer science class had to use Dr Java last year, but this year we use greenfoot.
Did any of you take the Computer Science AP exam? If so, could you direct me to some resources to study for it? Since my school doesn't have an AP Computer Science class and so I'm stuck with just the Java course.
[QUOTE=HumbleTH;48794387]Did any of you take the Computer Science AP exam? If so, could you direct me to some resources to study for it? Since my school doesn't have an AP Computer Science class and so I'm stuck with just the Java course.[/QUOTE] as long as you know how to program in java and learn their gridworld bullshit you should be a-ok
Sorry, you need to Log In to post a reply to this thread.