• What are you working on? December 2011 Edition
    3,353 replies, posted
Opinion time, perhaps? What do you think is best? [img]http://www.facepunch.com/fp/ratings/tick.png[/img] Releasing a largish-number of useful but generally smallish projects, finishing them, and putting them in your portfolio [img]http://www.facepunch.com/fp/ratings/cross.png[/img] Releasing a smallish-number of depthy, large projects which cover a handful of programming challenges and is refined to a convincible point, perhaps not completely finishing them, but rather at the absolute very least, finishing them where they're done "enough", and putting them in your portfolio [img]http://www.facepunch.com/fp/ratings/funny2.png[/img] Mastery by temperate completion of both small projects and perhaps a large project or two
[QUOTE=Naarkie;33917671][IMG]http://puu.sh/bEW8[/IMG] Yay, GUI :D (I think I'm on the omegle blacklist. Each time I connect I have to enter a captcha. Annoying.)[/QUOTE] Great, I'll fiddle around with it a bit and see what I can do.
[img]http://dl.dropbox.com/u/6470891/demislands.png[/img] DEM ISLANDS AND DAT OCEAN Spent half my programming time trying to fix why coasts wern't working and then suddenly they do FML Next to fuck with the generator to stop the islands from being so square and make the ocean more... ocean-y
[IMG]http://i.imgur.com/sUpcL.png[/IMG] Fuck yeah. Lua transliteration with (with a change or two due to interface updates) from C++. Original code by Voided: [cpp] int main() { SetDllDirectory("C:\\Program Files\\Steam\\"); eInitError errorCode; if (!Steamworks_Init(eInitSteamClient, errorCode)) { std::string errMsg = "Unable to init steamworks : "; errMsg += EnumString<eInitError>::From(errorCode); errMsg += "\n"; Error(errMsg); } int error; ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error); if (!steamClient) Error("Unable to get steam client.", error); HSteamPipe hSteamPipe = steamClient->CreateSteamPipe(); HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe); ISteamFriends001 *steamFriends = (ISteamFriends001 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_001 ); HSteamCall hSteamCall; CallbackMsg_t CallbackMsg; while (true) { if (Steam_BGetCallback(hSteamPipe, &CallbackMsg, &hSteamCall)) { if (CallbackMsg.m_iCallback == FriendChatMsg_t::k_iCallback) { FriendChatMsg_t *chatMsg = (FriendChatMsg_t *)CallbackMsg.m_pubParam; EFriendMsgType msgType; // allocate data for message char *pvData = new char[256]; memset(pvData, 0, 256); // i have no clue if steam dellocates this or if we should const char *friendName = steamFriends->GetFriendPersonaName(chatMsg->m_ulOtherID); steamFriends->GetChatMessage(chatMsg->m_ulSteamID, chatMsg->m_iChatID, pvData, 256, &msgType); if (msgType & k_EFriendMsgTypeTyping) { //steamFriends->SendMsgToFriend(chatMsg->m_ulOtherID, k_EFriendMsgTypeChatSent, ""); std::cout << "* " << friendName << " is typing a message..." << std::endl; } else std::cout << "* Message from " << friendName << ": " << pvData << std::endl; // clean up delete [] pvData; } Steam_FreeLastCallback( hSteamPipe ); } Sleep(1); } // yeah we never get here, sue me Steamworks_Shutdown(); return 0; }[/cpp] Lua transliteration by me: [lua]local bit if ( not jit ) then bit = require( "bit" ) else bit = _G.bit end require( "lopensteamworks" ) local hSteamPipe = ISteamClient012.CreateSteamPipe(); local hSteamUser = ISteamClient012.ConnectToGlobalUser(hSteamPipe); local steamFriends = ISteamClient012.GetISteamFriends( hSteamUser, hSteamPipe ); local b; local CallbackMsg; while(true) do b, CallbackMsg = Steam_BGetCallback(hSteamPipe) if (b) then if (CallbackMsg.m_iCallback == 805) then local chatMsg = CallbackMsg.m_pubParam; local msgType; -- i have no clue if steam dellocates this or if we should local friendName = steamFriends:GetFriendPersonaName(chatMsg.m_ulSenderID); local _, pvData, msgType = nil, "", 0 if (chatMsg.m_ulFriendID == chatMsg.m_ulSenderID) then _, pvData, msgType = steamFriends:GetFriendMessage(chatMsg.m_ulFriendID, chatMsg.m_iChatID); else _, pvData, msgType = steamFriends:GetFriendMessage(chatMsg.m_ulSenderID, chatMsg.m_iChatID); end if (bit.band(msgType, 2) ~= 0) then print( "* " .. friendName .. " is typing a message..." ); else print( "* Message from " .. friendName .. ": " .. pvData ); end -- clean up pvData = nil; end Steam_FreeLastCallback( hSteamPipe ); end end [/lua]
What's with the stars?
[QUOTE=Jookia;33921793]What's with the stars?[/QUOTE] Pasting issue, it's fixed now.
I've been having fun with vectors: [img]http://anyhub.net/file/21Ak-raycast.png[/img] Pretty much every problem I've had with it is because I've used angles to find out what is in the beam. Going to work on a way of doing it without angles now.
[QUOTE=Ziks;33922597]I've been having fun with vectors: [img]http://anyhub.net/file/21Ak-raycast.png[/img] Pretty much every problem I've had with it is because I've used angles to find out what is in the beam. Going to work on a way of doing it without angles now.[/QUOTE] Damn, that doesn't work that well? That's how I thought of solving that too.
[img]http://i.imgur.com/7sQl7.png[/img] Added a "Debug" menu; currently implemented is a listview showing the output of the tokenizer - helps to make sense of errors, seeing as I give error positions in terms of token indexes :v: I've also changed the differential syntax, and I think it's a lot better now: "d/d" is the differential operator, which takes an ID and an expression as its right operands. The operator is only recognised if the first "d" is a distinct ID, so "bad/d" still tokenizes to "bad divided by d". Hopefully no one who uses it will need to find the value of d divided by d. [editline]27th December 2011[/editline] Not a progress update, just thought this was kinda neat - plotting Taylor approximations to the sine function, of varying degrees: [img]http://i.imgur.com/TCFKs.png[/img] This is starting to turn into something I might actually use because of what it does, not just because I made it :v:
Just one more bit of kongregate idiocy: [quote=Gheata] Bugged! It crashes! (On porpouse=I can't fix it) [/quote] [quote=miezebeize] It doesn't even have witty replies for widespread profanities. [/quote]
[QUOTE=Yogurt;33922679]Damn, that doesn't work that well? That's how I thought of solving that too.[/QUOTE] The problems are mainly around the -180 -> 180 wraparound (well -pi -> pi). It's possible if you keep that in mind, but I feel dirty after using vectors for everything else and resorting to angles for that.
Today I got Valgrind memory checking for my game working. Ignoring leaks from my video card drivers, X11 and Boost all really tick me off, but I can't fix it from my application, so it's not worth my time. Maybe tomorrow I'll figure out unit tests. Well, time to hit the hay (maybe cry over lost love too) after doing that.
[QUOTE=Jookia;33923986]Well, time to hit the hay (maybe cry over lost love too) after doing that.[/QUOTE] Why is everybody so abusive to their hay? When I go to sleep I caress it gently and sing it a nice lullaby.
Recently entered my second Ludum Dare with a friend, did a few things I've never done before within that, and came out of it with fresh motivation to improve and expand, so I decided to move into tile-based games (at last). I originally worked out and implemented a simple tile-based system by myself, which included random map generation (with no pattern or smart generation algorithm) containing two different kinds of tiles, and a player entity with half-working collision on one kind of tile. Here's a video of that attempt: [video=youtube;uuoDENyGvXs]http://www.youtube.com/watch?v=uuoDENyGvXs[/video] I then saw the work that reevezy67 was doing on his new tile-based platformer and asked him for a bit of advice, and have spent the latter part of today working on this: [video=youtube;5cvhpwcQokM]http://www.youtube.com/watch?v=5cvhpwcQokM[/video] Next up for the platformer is a map editor of some kind, scrolling maps, and proper collision detection. Things're going well!
Variable watch window and procedure list are good to go. They're all mapped to F keys, so you just hit a key and they pop up - it's pretty handy :) [img]http://i.imgur.com/49qBl.png[/img] Did I mention they all update in real time? :v: Also, while fiddling: [img]http://i.imgur.com/PM02k.png[/img] Smoothing doesn't work so well because of the square steps, and the quality's a little low really, but that can be turned up in settings. I feel like I should add intensity / field plots, but that would only really work if I had access to alpha, which apparently wasn't in particularly common use back on 1998 :/
[QUOTE=Maurice;33919085]Working on Bowser behavior.. there's a lot to test with the original rom. [img]http://i.imgur.com/sVgNn.gif[/img] Ha-hah![/QUOTE] I'm still here for any research need.
[QUOTE=swift and shift;33918110]yeah exactly. You don't just use a c library straight, which is what i was meaning by that comment [editline]27th December 2011[/editline] and I don't see raii or any of that crap in the code i was originally replying to:[/QUOTE] To be fair, whilst RAII is pretty essential when using like exceptions etc in C++ generally if you don't use them you don't need it with careful planning. It's way more memory leak prone not using RAII though. I just flat out avoid exceptions in C++ though, I just find they're not needed
[code]1>------ Build started: Project: SFML, Configuration: Debug Win32 ------ 1> main.cpp 1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main 1>C:\Users\Kepler\documents\visual studio 2010\Projects\SFML\Debug\SFML.exe : fatal error LNK1120: 9 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] [code] #include <SFML\Window.hpp> #include <SFML\Graphics.hpp> int main() { sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "Worth the weight 2.0"); sf::Event fat; while(Game.IsOpened()) { while(Game.GetEvent(fat)) { if(fat.Type == sf::Event::Closed) Game.Close(); } Game.Clear(); Game.Display(); } } [/code] What does it mean? I didn't get this problem with SDL
You're not linking SFML?
[QUOTE=jonnopon3000;33924361]Recently entered my second Ludum Dare with a friend, did a few things I've never done before within that, and came out of it with fresh motivation to improve and expand, so I decided to move into tile-based games (at last). I originally worked out and implemented a simple tile-based system by myself, which included random map generation (with no pattern or smart generation algorithm) containing two different kinds of tiles, and a player entity with half-working collision on one kind of tile. Here's a video of that attempt: [video=youtube;uuoDENyGvXs]http://www.youtube.com/watch?v=uuoDENyGvXs[/video] I then saw the work that reevezy67 was doing on his new tile-based platformer and asked him for a bit of advice, and have spent the latter part of today working on this: [video=youtube;5cvhpwcQokM]http://www.youtube.com/watch?v=5cvhpwcQokM[/video] Next up for the platformer is a map editor of some kind, scrolling maps, and proper collision detection. Things're going well![/QUOTE] There is a lot of things wrong with the code I gave you that I would change now, I basically planned to go through and figure out how it was going to work without worrying about keeping the code clean and then rewrite it. [editline]28th December 2011[/editline] Mainly being the compensation for velocity in the collision detection isn't all that great.
Some kongregate user just PM'd me and asked me how to upload a game. I asked him what type and he said "I don't know, I didn't make it"
[QUOTE=amcfaggot;33926374]You're not linking SFML?[/QUOTE] [IMG]http://i.imgur.com/7j8GY.png[/IMG]
You should probably link graphics and window too
Squashed some bugs, added a few functions that I felt it was lacking - on the language-y side, there's now an input() function that gets user input from the user, and I've added two different random functions - one of which returns completely pseudorandom values, and another of which is deterministic based on its input. I can feel my productivity declining as this gets more fun to play with - here's a simple 1d perlin noise / terrain function I knocked together in a few minutes: [img]http://i.imgur.com/10mpe.png[/img] This would be pretty easy to extend to 2d, but I think I've been diverted enough :v: at the minute I'm pondering how I might do arrays, I think I'll sleep on it.
[QUOTE=NovembrDobby;33926840]You should probably link graphics and window too[/QUOTE] Oh, shoot, forgot. [quote]A buffer overrun has occurred in SFML.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.[/quote] Alright, what now. Using the same code.
Try creating sf::RenderWindow and sf::Event on the heap.
[QUOTE=Kepler;33927210]Alright, what now. Using the same code.[/QUOTE] You should be using SFML's debug libs if you're compiling on debug mode.
So after starting Nature 2, I've gotten a lot of positive feedback and cheers. So I held a party. [img]http://img1.uploadscreenshot.com/images/orig/12/36012572337-orig.jpg[/img]
>2011 >not being in fpp picture
>2011 >posting after 4 AM
Sorry, you need to Log In to post a reply to this thread.