• What are you working on? V5
    2,005 replies, posted
[QUOTE=Pj The Dj;18849937]this is madly off topic and probably noones cares, but platinum arts sandbox is just a worse version of cube 2 where everything is taken away and what is added doesn't even work.[/QUOTE] Meh, this thread has turned into a programming discussion thread. Which is fine with me though :D.
Coding object console commands. So you can run console commands on a world/entity object and if they're not picked up on the client they're sent to the server properly.
[QUOTE=Sippeangelo;18849563]How the hell do I specify the size of a Win32 window excluding the window borders? I guess I could just assume that the side and the bottom border are 4 px and the top is whatever size, but it can differ from os to os and user defined settings...[/QUOTE] I don't know about the MFC, but in .net and Delphi, there's a ClientHeight and ClientWidth property that gets/sets the size excluding borders.
Working on a program in which you can select a module and it will do it in the render panel. Each module derives from a BaseModule class and you simply register a pointer instance of it (must be declared as new) and it will add it to the selection box thing on the right of the window along with parameters for that module. It's for testbedding 2d stuff, it uses SFML and box2d. It's going to be for things like patterns (fractals, random walks) and for things like simple physics machines and simulations. Gona work on a system of layers.
What software is good for designing a program? I mean in terms of Code structure and flow, I remember there being a thread about this before but I can't find it.
[QUOTE=Mattz333;18851162]What software is good for designing a program? I mean in terms of Code structure and flow, I remember there being a thread about this before but I can't find it.[/QUOTE] UML - Univeral Modelling Language. It is THE standard for design. [url=http://staruml.sourceforge.net/en/]Star UML[/url] is a free tool for UML diagrams. For structure there are things like class diagrams, for flow there are things like activity diagrams and data flow diagrams and for an overall design of the system there are things like use case diagrams and descriptions. Honestly I've never done more designing than sketching something though.
[QUOTE=GreyIOutcast;18847524]If R = 0, that's unrealistic coding. That would mean you have one mass inside another.[/QUOTE] Right. And given particle physics, R = 0.00001 means that the masses are [i]not[/i] inside each other, yet the resulting force is [i]huge[/i].
[QUOTE=garry;18628989]So let me ask you this, C++, how would you ideally have entities message each other? I don't want to have to cast to the specific entity type, I want it to be fast and simple to use. What would you do?[/QUOTE] I'm wondering what sort of code you used to solve this problem, I'm trying to build my own messaging system that does exactly that and currently my solution uses a templated approach in which each class derived from "Messageable" can receive any arbitrary message using syntax similar to: [cpp] class MyMessage : public Message { public: int varNotDeclaredInMessage; void someFunctionNotDeclaredInMessage(); }; class MyMessageable : public Messageable { public: MyMessageable() { this->bindFunction<MyMessageable, MyMessage>(); } void handleFunction(MyMessage& message) { print(message.varNotDeclaredInMessage); message.someFunctionNotDeclaredInMessage(); } }; int main() { MyMessageable messageable; MyMessage message; message.varNotDeclaredInMessage = 1; messageable.dispatchMessage(message); } [/cpp] However this approach relies on two static casts in order to work properly. Did you end up finding a better solution? (Code for the Messageable and Message class is available at: [url]http://github.com/Vodurden/AML[/url] )
Just me (and msvc) or does std::string index out of range cause an exception which try/catch can't handle? If it does then that is fucking pointless! Also if this is true I am gonna start working on a library like .NET(IE, Streams, Exceptions, etc). So much about the C++ standards are fucking pissing me off.
[QUOTE=GreyIOutcast;18847524]If R = 0, that's unrealistic coding. That would mean you have one mass inside another. Only way that is possible if it is the same mass, in which case gravity wouldn't be in play. Just electromagnetic, strong nuclear, and weak nuclear, which has nothing to do with this (although if he got it so the particles contained the subparticles, that would be pretty interesting). Slightly relevant note: The mass on the periodic table is the mass in grams per mole, right? [editline]08:00PM[/editline] So I would say try making it so that distance can be a float, not a single integer based on distance in pixels.[/QUOTE] Electro[i]static[/i] force is described using same formula, except instead of masses you have charges, and instead of gravity constant you have different constant (which depends on envrionment), and has same 1/(r^2) dependance. Usually gravity is so weak, that you can't get two particles close for the forces to start rising towards infinity, same with electrostatic force (which is stronger, but still so weak that particles never get close). Yes, the mass is in atomic mass units, which are grams per mole.
[QUOTE=Sippeangelo;18849563]How the hell do I specify the size of a Win32 window excluding the window borders? I guess I could just assume that the side and the bottom border are 4 px and the top is whatever size, but it can differ from os to os and user defined settings...[/QUOTE] [url]http://msdn.microsoft.com/en-us/library/ms632665%28VS.85%29.aspx[/url]
Jesus what's with all the gold members [editline]09:43PM[/editline] It's my birthday why don't I have Gold Member :v:
2k posts. Spam for a gold name pretty much
[QUOTE=databee;18853488]2k posts. Spam for a gold name pretty much[/QUOTE] [url]http://www.facepunch.com/showpost.php?p=18853343&postcount=252[/url] I see, posted 20 minutes ago, so he posted 100 times in 20 minutes.
Coding some random 3D stuff with BlitzMax
[QUOTE=BlackPhoenix;18852796]Electro[i]static[/i] force is described using same formula, except instead of masses you have charges, and instead of gravity constant you have different constant (which depends on envrionment), and has same 1/(r^2) dependance. Usually gravity is so weak, that you can't get two particles close for the forces to start rising towards infinity, same with electrostatic force (which is stronger, but still so weak that particles never get close). Yes, the mass is in atomic mass units, which are grams per mole.[/QUOTE] I tried all the suggestions posted here, but it just got worse. That's how I'm calculating it right now: [cpp]final double G = 5; final double E = 20; double force = (G * (mass1) * (mass2)) / (Math.pow(distance, 2)); //masses are 1 force -= (E * (mass1) * (mass2)) / (Math.pow(distance, 4));[/cpp] [QUOTE=r4nk_;18853426]Jesus what's with all the gold members [editline]09:43PM[/editline] It's my birthday why don't I have Gold Member :v:[/QUOTE] Happy birthday! :smile:
Level editor, day 1. Got entities creating. [img]http://filesmelt.com/downloader/11Dec2009_001.png[/img]
[QUOTE=garry;18854855]Level editor, day 1. Got entities creating. *img*[/QUOTE] Seriously I have no idea how you can code completely new features that fast...
[QUOTE=s0ul0r;18854972]Seriously I have no idea how you can code completely new features that fast...[/QUOTE] Not having anything else to do helps a lot :v: [B]Edit:[/B] Better now?
[QUOTE=s0ul0r;18854972]Seriously I have no idea how you can code completely new features that fast...[/QUOTE] It's because he fooled all of facepunch into posting lots, then turned loads of us into goldmembers and now uses us as a hivemind. (just typed that out first time and missed out loads of words - I have lost some independant intelligence to the hivemind) But seriously I agree. I have no idea how garry works so fast. [QUOTE=Robber;18854993]Not having a job helps a lot :v:[/QUOTE] It is his job. Maybe that is what helps a lot.
It's not really that much.. I had to make a canvas containing a docking panel then make a panel that listed the entities.. [cpp]class EntiityListPanel : public Controls::Base { public: EntiityListPanel( Controls::Base* pParent, CEditorWorld* pWorld ) : Controls::Base( pParent ) { m_World = pWorld; Populate(); } virtual void OnEntityPress( Base* pControl ) { m_World->ObjectCommand( LocalPlayer(), "spawnent %s", pControl->GetName().c_str() ); } void Populate() { IEntityDefinition::List& list = entityfactory->GetList(); int y = 0; BOOST_FOREACH( IEntityDefinition* def, list ) { Button* btn = new Button( this ); btn->SetText( def->GetName() ); btn->SetPos( 0, y ); btn->SetName( def->GetName() ); btn->onPress.Add( this, &EntiityListPanel::OnEntityPress ); y += btn->Height(); } } protected: CEditorWorld* m_World; };[/cpp] Then a panel that draws the view.. [cpp]ViewPanel::ViewPanel( Controls::Base* pParent, CEditorWorld* pWorld ) : Controls::Base( pParent ) { m_World = pWorld; m_pView = Interface::Render()->CreateView(); } ViewPanel::~ViewPanel() { m_pView->Release(); } void ViewPanel::Render( Gwen::Skin::Base* skin ) { Interface::Render()->ClearDepth(); m_pView->SetEyePos( Vector( 10, 10 + sin(Time::Get()) * 5.0f, 0 ) ); m_pView->SetLookAt( Vector( 0, 0, 0 ) ); Gwen::Point p = LocalPosToCanvas( Gwen::Point(0,0) ); m_pView->SetScreenRect( Bootil::Rect( p.x, p.y, p.x + Width(), p.y + Height() ) ); m_pView->Start(); m_World->RenderScene( Interface::Render() ); m_pView->End(); }[/cpp] Hook the world function up so it can spawn the entity (on the server) [cpp]AddCommand( "SpawnEnt", &CEditorWorld::SpawnEntity );[/cpp] and define it [cpp]void CEditorWorld::SpawnEntity( Console::Command::Parameters& p ) { IEntity* pEnt = CreateEntity( p.Arg[1] ); if ( pEnt ) { pEnt->Spawn(); } }[/cpp] And it's ready! It isn't a lot of coding because I've been spending the last few months laying the groundwork for all this to happen.
[QUOTE=garry;18855103]It's not really that much.. I had to make a canvas containing a docking panel then make a panel that listed the entities.. It isn't a lot of coding because I've been spending the last few months laying the groundwork for all this to happen.[/QUOTE] You still have an amazing turn around with adding new features. :P
I always find that it is easier adding these features as long as you have a general idea of what you want to do. I am guessing he has coded enough to know what he has to do to get certain results, making it easier.
[QUOTE=Squad;18855793]I always find that it is easier adding these features as long as you have a general idea of what you want to do. I am guessing he has coded enough to know what he has to do to get certain results, making it easier.[/QUOTE] Yeah, he coded the entire backend, I'd imagine that with all of that knowledge, he knows all of the functions and what he needs to do. :3
Man garry is sure fast on coding new features
[QUOTE=Squad;18820829]I have found that by including '-1' randomly throughout my code usually solves every problem...[/QUOTE] I find the best solution is simply [code]#define if while[/code] That tends to fix most of my coding problems. [editline]03:11AM[/editline] Actually, I think the major problem with my coding is the fact that I'm actually trying to code.
[QUOTE=mechanarchy;18856068]I find the best solution is simply [code]#define if while[/code] That tends to fix most of my coding problems. [editline]03:11AM[/editline] Actually, I think the major problem with my coding is the fact that I'm actually trying to code.[/QUOTE] That one is alright, I find that [code]#define { /* #define } */[/code] works best. I feel like I'm shit posting. Going to cut down the amount of crap I post now and wait until I actually have made something.
I find that if I yell at my code for a while it usually works, or else I just revert to one of my [b]daily backups[/b].
If i'm making a flash application/game for a website, can it be posted here? :smug:
[QUOTE=Giraffen93;18857342]If i'm making a flash application/game for a website, can it be posted here? :smug:[/QUOTE] Web Programming.
Sorry, you need to Log In to post a reply to this thread.