• Programming - WAYWO - March 2013
    1,001 replies, posted
[QUOTE=Rayboy1995;39738846]Just got tanks implemented into my game(Ignore the temporary name). [IMG]http://img560.imageshack.us/img560/6041/wargame1.png[/IMG] Also its multiplayer, using the UDP servers I made a while back. I still need to implement TCP for sending packets other than game updates though. [editline]27th February 2013[/editline] Also the terrain is destructible, forgot to add that.[/QUOTE] You gonna open-source that? Also if it's uploaded anywhere, link plz
Pretty sure most of you don't know me but I've managed to land in twelfth place in the swedish "Programming Olympiad" ([url]http://progolymp.se/[/url]) which is a yearly contest for highschools in which you are to code 7 programs in order to solve problems, in 6 hours. This competition is held in whole sweden so woo! This is also connected to the IOI (International Olympiad in Informatics) which is held in Australia this year, if you've managed to get to the swedish finals you can compete in a weekend competition where you have a chance to fight for sweden in the IOI, which means I have a chance getting to Australia! Woo!
I've been working on a program for a trading company for over a month now, which has a large variety of features, such as multiple user types (operators, branches, admins), management of clients, goods, currencies, transports, branches, imports, orders, drafts, returns, invoices (with printing) and a lot of more minor functionalities. The whole thing is supposed to run in standalone applications in different offices and countries. All the program clients are connected to a single cloud server, which handles all the functionality and stores all the databases, synching all the branches together. This is my most complex project to date! I know you like pictures but since I have to blur lots of info in the screenshots, the pic below is the best I can do. When a tab is selected, more tabs become available (there may be 2-3 rows of tabs visible at a time): [img]https://dl.dropbox.com/u/63022573/space/trade.png[/img] And now something different. This is not exactly what I'm working on, but rather what I've stopped working on. Some of you might know that I've ran a blog for over 2.5 years where I published my own programming tutorials every day, I wrote about AS3, Flex, Air, Android and some more technologies. It's really sad but today I basically closed my blog with a [url="http://kirill-poletaev.blogspot.com/2013/03/hiatus.html"]final hiatus post[/url]. It was a long run and I learned a LOT of stuff during these years. Here are some stats it has gained over the years: 985 posts 602,380 all-time hits 74 followers 650 comments average daily pageviews: over 1000 On a bright side, I'll have time to work on new projects that won't require that much time dedication every day.
[QUOTE=Nigey Nige;39763251]You gonna open-source that? Also if it's uploaded anywhere, link plz[/QUOTE] Err I don't know. I may do so after I'm done with it. [editline]1st March 2013[/editline] [IMG]http://img26.imageshack.us/img26/7716/wargame2.png[/IMG] Beep beep I'm a jeep.
[media]http://www.youtube.com/watch?v=Ivs9vcvxB5o[/media] Been working on an application that helps users know some information when driving, it's all done with voice-recognition and crowdsourcing in mind. If I do continue I will probably add the ability to answer calls and messages too.
I've kind of fallen in love with [URL="http://questionablecontent.net/"]Questionable Content[/URL], but I wanted a simpler way to go to the next comic, so I decided to make a ruby script that'd download the images, and then I'll put them into a PDF. And now I'm in love with Ruby. I thought that Ruby was a little simple, and that I couldn't really use it for anything, but here I am. But for some reason, it keeps stopping at random times, which is kinda annoying. [code]require "open-uri" puts "Enter start comic: " start_comic = Integer(gets.chomp) puts "Enter end comic: " end_comic = Integer(gets.chomp) for i in start_comic..end_comic puts "Downloading #{i}.png" open("http://questionablecontent.net/comics/#{i}.png"){|f| File.open("#{i}.png", "wb") do |file| file.puts f.read end } end[/code] [editline]1st March 2013[/editline] I started doing this at 21:57. It's now 22:13 and I've downloaded 214 of 2396 images...
Minesweeper remake in python: [IMG]http://i.imgur.com/YwLmUkA.png[/IMG] Complete with path finding and everything! [IMG]http://i.imgur.com/J0jb6Nh.png[/IMG]
[QUOTE=bunguer;39763939][media]http://www.youtube.com/watch?v=Ivs9vcvxB5o[/media] Been working on an application that helps users know some information when driving, it's all done with voice-recognition and crowdsourcing in mind. If I do continue I will probably add the ability to answer calls and messages too.[/QUOTE] Cool concept and app, though the grammar in the video bothers me a little (I get the accent, but you missed a word somewhere in there with the text), and the audio is a little loud, and I feel like it could startle me while I'm driving or something. (it actually kinda startled me a couple times while watching that video)
[QUOTE=Gulen;39764116]I've kind of fallen in love with Questionable Content, but I wanted a simpler way to go to the next comic, so I decided to make a ruby script that'd download the images, and then I'll put them into a PDF. And now I'm in love with Ruby. I thought that Ruby was a little simple, and that I couldn't really use it for anything, but here I am. But for some reason, it keeps stopping at random times, which is kinda annoying. [code]require "open-uri" puts "Enter start comic: " start_comic = Integer(gets.chomp) puts "Enter end comic: " end_comic = Integer(gets.chomp) for i in start_comic..end_comic puts "Downloading #{i}.png" open("http://questionablecontent.net/comics/#{i}.png"){|f| File.open("#{i}.png", "wb") do |file| file.puts f.read end } end[/code] [editline]1st March 2013[/editline] I started doing this at 21:57. It's now 22:13 and I've downloaded 214 of 2396 images...[/QUOTE] Change Integer(gets.chomp) to gets.chomp.to_i, it's more Ruby-like that way
[QUOTE=Gulen;39764157]Cool concept and app, though the grammar in the video bothers me a little (I get the accent, but you missed a word somewhere in there with the text), and the audio is a little loud, and I feel like it could startle me while I'm driving or something. (it actually kinda startled me a couple times while watching that video)[/QUOTE] Thanks for the feedback! I completely agree with you, to give more of a backstory, this was done for a competition and as usual with these things I spent most of the time worrying about the app itself than the video which left it a little bit rushed, but this shouldn't be an excuse. You can control how loud you want the voice to be in app though.
[QUOTE=Mega1mpact;39761417]Holy shit [url]https://twitter.com/hukl/status/307469987826761729[/url] [img]http://puu.sh/2aknD[/img] [editline]1st March 2013[/editline] Also works on mac Please remember that a lot of desktop environments allow any user to change the time/date for some reason.[/QUOTE] [code] $ timedatectl set-time "1970-01-01 00:00:00" Failed to issue method call: Access denied [/code] Yay Arch Linux. [editline]1st March 2013[/editline] [QUOTE=sambooo;39764294]Change Integer(gets.chomp) to gets.chomp.to_i, it's more Ruby-like that way[/QUOTE] Really just gets.to_i, String#to_i already ignores surrounding whitespace.
Finished adding constant table support to my vm's compiler. I need to make it also always use the same endian, but I'll deal with that later. Here is a useless program: [CODE] ctable "nope" ctable "yep" thisisalabel: push 9 push 3 push 88 push 0 push "Hello World!" push true push false goto thisisalabel [/CODE] The compiler takes all non-integer pushes, adds the constants to the constant table if needed, then replaces them with loadk (load from constant table onto stack). ctable just manually adds constants to the table (the compiler doesn't care where you put ctable, though the order of the ctable statements matter). It gets compiled into this: [t]http://i.imgur.com/KaKBQBj.png[/t] The current format for my binary is as follows (in C-like pseudocode): [CODE] // Header char[3] identifier = "SVM" uint32 version // Version of the compiler, right now it is 2 uint32 ctable_count // Number of entries in the constant table // Then come all of the constants in order. Each type is stored differently // Constant - nil/null uint8 type = Shogun::Data::NIL // Constant - integer uint8 type = Shogun::Data::INTEGER int32 data // Constant - boolean uint8 type = Shogun::Data::BOOLEAN uint8 data // Constant - string uint8 type = Shogun::Data::STRING uint32 length // Including NULL-terminator char[len] data // Then comes the opcodes uint8 opcode int32 argument1 ... argumentN // If there are any arguments at all [/CODE] I haven't had a chance (or the patience) to fully check the binary to see if everything is correct, but I did check at least the header and constant tables (though there is some weirdness in the size of each field - i need to check that).
[QUOTE=Larikang;39765114][code] $ timedatectl set-time "1970-01-01 00:00:00" Failed to issue method call: Access denied [/code] Yay Arch Linux. [editline]1st March 2013[/editline] Really just gets.to_i, String#to_i already ignores surrounding whitespace.[/QUOTE] The issue is not with cli, the command line requires sudo to change the date and time. The issue is with desktop environments not requiring it when done through the UI.
[IMG]http://puu.sh/2axdn[/IMG] I took a week off from my space game project to fiddle around with an AOE2 clone again. Red Rect = Debug View Rect, Blue = Culling Rect I have simple terrain rendering/batching/culling going on, a bit of a simulation backend with fixed math to ensure it runs correctly on different computers. I also imported the data system I'm using for my other game to save some time. [URL="https://github.com/Simie/EmpireSharp"]Source here[/URL] if anyone is interested at looking at my terrible code.
[QUOTE=Donkie;39763460]Pretty sure most of you don't know me but I've managed to land in twelfth place in the swedish "Programming Olympiad" ([url]http://progolymp.se/[/url]) which is a yearly contest for highschools in which you are to code 7 programs in order to solve problems, in 6 hours. This competition is held in whole sweden so woo! This is also connected to the IOI (International Olympiad in Informatics) which is held in Australia this year, if you've managed to get to the swedish finals you can compete in a weekend competition where you have a chance to fight for sweden in the IOI, which means I have a chance getting to Australia! Woo![/QUOTE] Don't eat the vegemite.
[QUOTE=bunguer;39763939][media]http://www.youtube.com/watch?v=Ivs9vcvxB5o[/media] Been working on an application that helps users know some information when driving, it's all done with voice-recognition and crowdsourcing in mind. If I do continue I will probably add the ability to answer calls and messages too.[/QUOTE] Add a dash HUD
I just don't get integer promotion rules with the unary ~ and - [cpp]unsigned long long i = ~(unsigned char)1; // Promoted to 1ULL before doing binary negation and assignment unsigned long long i = ~1UL; // NOT promoted to 1ULL before doing negation (as far as the standard is concerned, I think it should) unsigned int tmp = 1; unsigned long long i = ~(unsigned char)tmp; // Promoted to 1ULL before doing negation unsigned long long i = ~(unsigned short)tmp; // Promoted to 1ULL before doing negation... unsigned long long i = ~(unsigned int)tmp; // Surprise! Not promoted to 1ULL before negation. unsigned long long i = ~tmp; // Not promoted.[/cpp] When passed to functions, however, it gets promotions like it should [cpp]void func(unsigned long long x); func(~(unsigned int)1); // Surprise again! This time it gets promoted to 1ULL before negation[/cpp] [editline]2nd March 2013[/editline] This behaviour is in GCC and MSVC
Bullets [img]http://puu.sh/2aAmG[/img]
Bonus: [cpp]// Bob has 18 quintillion apples unsigned long long bob = ~(unsigned char)1; // 18446744073709551614 // He gives 4 billion of them to Alice unsigned long long alice = ~(unsigned int)1; // 4294967294 // How many apples is Bob left with? unsigned long long bobn = ~(unsigned char)1 - ~(unsigned int)1;[/cpp] [sp]Bob is left with 0 apples![/sp]
[QUOTE=ThePuska;39767102]I just don't get integer promotion rules with the unary ~ and - [cpp]unsigned long long i = ~(unsigned char)1; // Promoted to 1ULL before doing binary negation and assignment unsigned long long i = ~1UL; // NOT promoted to 1ULL before doing negation (as far as the standard is concerned, I think it should) unsigned int tmp = 1; unsigned long long i = ~(unsigned char)tmp; // Promoted to 1ULL before doing negation unsigned long long i = ~(unsigned short)tmp; // Promoted to 1ULL before doing negation... unsigned long long i = ~(unsigned int)tmp; // Surprise! Not promoted to 1ULL before negation. unsigned long long i = ~tmp; // Not promoted.[/cpp] When passed to functions, however, it gets promotions like it should [cpp]void func(unsigned long long x); func(~(unsigned int)1); // Surprise again! This time it gets promoted to 1ULL before negation[/cpp] [editline]2nd March 2013[/editline] This behaviour is in GCC and MSVC[/QUOTE] Ecma-334(C#) has information on the craziness of numeric promotions. Even though its C# it should be very similar to C++. [url]http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf[/url] 14.2.6 Numeric promotions
Been exploring how steam stores data and stuff. Checked into bioshock infinite, apparently the game is uploaded to the steams servers, has a 953.7 MB steam cloud storage availability, the install script installs direct x, vc redist 08, vc redist 10, and d3d11 install, it has these languages: "languages" "english,french,italian,german,spanish,japanese,brazilian", it's definitely singleplayer, has a lot of dlc: "ListOfDLC" "214930,214931,214932,214933,214934,214935,214936,214937,214938,220140,224090", most depots have "accesspr, dlc01, feb2013, main, media_generation, press_tour, review_build_p, submission_pc, version_patch_1, version_rtm The basic folder structure/ depots is as follows: [code] depot 224091 Prerequisites depot 224090 DebugBinaries depot 8878 Binaries depot 8874 Config depot 8877 Content depot 8873 Engine depot 8875 Localization_INT depot 8876 Movies depot 224081 Localization_DEU depot 224082 Localization_ESN depot 224083 Localization_FRA depot 224084 Localization_ITA depot 224085 Localization_JPN depot 224087 Localization_POR depot 224089 Localization_KOR depot 224088 Localization_RUS depot 224086 Localization_POL depot 225935 DLC_P1 depot 214936 DLC_P2 depot 214933 DLC_SP depot 214934 DLC_CE depot 214937 DLC_IR depot 214930 DLC_1 depot 214931 DLC_2 depot 214932 DLC_3 [/code] Has some interesting branch info too: [code] "branches" { "accesspr" { "buildid" "42633" "description" "\"For Access PR, Currently set to Dec2012 Demo build 31956\"" "pwdrequired" "1" } "dlc01" { "buildid" "47215" "description" "DLC 1 Test Branch" "pwdrequired" "1" } "dlc01-milestone" { "buildid" "42078" "description" "DLC 1 Milestone Branch" "pwdrequired" "1" } "dlc01-tech" { "buildid" "47004" "description" "DLC 1 Test branch for progammers" "pwdrequired" "1" } "empty_build" { "buildid" "13763" "description" " -- empty branch to hold an empty build, for test purposes" "pwdrequired" "1" } "feb2013" { "buildid" "42633" "description" "(W/ PORTCULLIS) Updated PC demo for Mktg use" "pwdrequired" "1" } "main" { "buildid" "47707" "description" "Main branch" "pwdrequired" "1" } "media_generation" { "buildid" "44508" "description" "For G-Net and other external companies doing trailers and screenshots" "pwdrequired" "1" } "press_tour" { "buildid" "47258" "description" "(NO PORTCULLIS!) For european press tour. Game cuts off before HoH." "pwdrequired" "1" } "Public" { "buildid" "44383" } "review_build_p" { "buildid" "47707" "description" "PC review build (w/Portcullis)" "pwdrequired" "1" } "submission_pc" { "buildid" "48365" "description" "DO NOT TEST: Internal development of upcoming patches" "pwdrequired" "1" } "toamd" { "buildid" "47837" "description" "ToAmd branch" "pwdrequired" "1" } "version_patch_1" { "buildid" "47371" "description" "!!! Day 1 Patch Candidate" "pwdrequired" "1" } "version_rtm" { "buildid" "44508" "description" "Original versionof game that was RTM'd and boxed as WorldWide EFIGS+Portugese+Japanese SKU" "pwdrequired" "1" } } [/code] Edited: Attempting to enable license for package: 8870 Failed to enable license for package: 8870 steam the fun polis
[QUOTE=Donkie;39763460]Pretty sure most of you don't know me but I've managed to land in twelfth place in the swedish "Programming Olympiad" ([url]http://progolymp.se/[/url]) which is a yearly contest for highschools in which you are to code 7 programs in order to solve problems, in 6 hours. This competition is held in whole sweden so woo! This is also connected to the IOI (International Olympiad in Informatics) which is held in Australia this year, if you've managed to get to the swedish finals you can compete in a weekend competition where you have a chance to fight for sweden in the IOI, which means I have a chance getting to Australia! Woo![/QUOTE] Congrats! I was in the qualifying round some years ago and passed to the final, but that clashed with other stuff, so I never participated. I was going to try again the next year, but that never happened. :v:
I've been working on a game called Vanity, which is a top-down arcade shooter that is supposed to be so fast paced you don't know what the hell is happening, or something like that. The music was made by a friend of mine named Pitfall, who had most of the music made before the game was even created! [media]http://www.youtube.com/watch?v=knKhtbtVhTQ[/media] I've got the game and the latest version on [url="http://www.indiedb.com/games/vanity"]IndieDB[/url] and [url="http://gamejolt.com/games/arcade/vanity/12625/"]GameJolt[/url], but I will most likely sell the game on Desura and Steam once it is finished. And now I got the whole weekend to work on it. Yay!
[QUOTE=esalaka;39763186]You [I]should[/I] need it but some systems/desktop environments allow for it without privileges.[/QUOTE] [QUOTE=Chris220;39762839]Stuff like Gnome and KDE allow you to change the time without needing a password, presumably for the sake of convenience.[/QUOTE] You shouldn't be changing the date and time, unless you're the sysadmin (root). The only exception to this is adjusting the user's time zone, which shouldn't matter since Unix stores dates as UTC then adds the time zone on. I have no idea if that's per-user, though...
[QUOTE=ZenX2;39767172]Bullets [img]http://puu.sh/2aAmG[/img][/QUOTE] Are you sampling for bullets...? Raytrace my dude!
Remember these things?: I found a use for the scary java: [IMG]http://i.imgur.com/WZ4lZuL.png[/IMG] Turns any window--into an 8bit music generator! [URL="http://filesmelt.com/dl/musical_chairs.7z"]musical_chairs.7z[/URL] (Only works on windows machines, to open the overlay press shift+tab) Good examples: [code] Static generator 9000 Math.random()*16 Chaos Theory cover w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s Personal favorite: (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6) [/code] (bottom two not by me) Big list: [URL]http://pelulamu.net/countercomplex/music_formula_collection.txt[/URL]
[QUOTE=Jawalt;39769210]Are you sampling for bullets...? Raytrace my dude![/QUOTE] They're all physically simulated circles, works really well. Also I added throwing and picking up weapons like Hotline Miami [editline]1st March 2013[/editline] [QUOTE=Map in a box;39769474]Remember these things?: I found a use for the scary java: [IMG]http://i.imgur.com/WZ4lZuL.png[/IMG] Turns any window--into an 8bit music generator! [URL="http://filesmelt.com/dl/musical_chairs.7z"]musical_chairs.7z[/URL] (Only works on windows machines, to open the overlay press shift+tab) Good examples: [code] Static generator 9000 Math.random()*16 Chaos Theory cover w=t>>9,k=32,m=2048,a=1-t/m%1,d=(14*t*t^t)%m*a,y=[3,3,4.7,2][p=w/k&3]*t/4,h="IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4)/33*t-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-a-a))),s*s>>14?127:s Personal favorite: (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6) [/code] (bottom two not by me) Big list: [URL]http://pelulamu.net/countercomplex/music_formula_collection.txt[/URL][/QUOTE] This is extremely cool (the program itself, and how advanced these have gotten)
Took only 3 hours getting the overlay to work properly(it's just a window over another window) and like 30 minutes to get the music part(i already have a library for it :v:). But yeah it's insane how far they've gotten. Given time, I wonder if there will be a music generator.
Found this old snippet from an old thread that enumerates all the possible capitalizations of a given string. [QUOTE=swift and shift][CODE]import Data.Char import Data.Function caps [] = [[]] caps (x:xs) = on (++) (flip map $ caps xs) (toLower x :) (toUpper x :) main = print $ caps "waywo"[/CODE][/QUOTE] Decided to rewrite it a bit shorter: [CODE]import Control.Applicative import Data.Char caps = mapM $ (<*>) [toLower, toUpper] . pure main = print $ caps "waywo"[/CODE] [QUOTE=output]["waywo","waywO","wayWo","wayWO","waYwo","waYwO","waYWo","waYWO","wAywo","wAywO","wAyWo","wAyWO","wAYwo","wAYwO","wAYWo","wAYWO","Waywo","WaywO","WayWo","WayWO","WaYwo","WaYwO","WaYWo","WaYWO","WAywo","WAywO","WAyWo","WAyWO","WAYwo","WAYwO","WAYWo","WAYWO"][/QUOTE]
[QUOTE=ArgvCompany;39770407]Found this old snippet from an old thread that enumerates all the possible capitalizations of a given string. Decided to rewrite it a bit shorter: [CODE]import Control.Applicative import Data.Char caps = mapM $ (<*>) [toLower, toUpper] . pure main = print $ caps "waywo"[/CODE][/QUOTE] If I remember correctly, That was made for guessing imgur URLs?
Sorry, you need to Log In to post a reply to this thread.