Jump to content

Mumbles

Members
  • Posts

    691
  • Joined

  • Last visited

Posts posted by Mumbles

  1. 7) No need to install runtime dlls

     

    Ever since you mentioned it to me, one thing I've always done is include those three runtime DLLs in the working directory. No reaon to install the entire lot when it only needs those 3 right? Unless 2010 and newer or so much different from 2008.

  2. Consoles have basically become EA, Activision and UBISoft delivery systems. Nobody else need apply as the production costs have once again gone through the roof.

     

    That in itself might just bring games back where they belong.

  3. Or maybe your local newspaper could give your local authority some unwanted publicity and get them to shorten the waiting time.

     

    To be honest, if there's only so much money to go around, I'm sure it's more appropriate to help people who are far less fit and active than I am. At the moment, I'm still very healthy and you wouldn't know there was anything wrong by looking at me. If Yorkshire think they've got the money for this, when the North West is struggling, then I'd totally say just move short term. (Yorkshire's waiting lists is larger, and there's fewer people on it in the first place)

     

    You know, I might right now be looking after my mum who had a stroke in 2004, and then a heart attack in 2009, but equally my brothers are old enough to help now. If they can manage while I move to Yorkshire, wait out the waiting list and then wait out all the red tape involved, then I'm sure we'll all get through it all.

     

    Also, it's a case of: Who am I? Why am I so important that I deserve a shorter waiting time than anyone else in the North West? To me, the answer is that I don't, because I'm no one special, and should wait the same amount of time that anyone else would be expected to...

  4. Almost like a bolt from the blue I find myself suddenly relying on the generosity of others. With only a couple of months warning, I find myself needing to move to a totally different area of the country. Without putting too fine a point on it, shall we say it's to do with healthcare. Whilst our NHS is famed as being a free service for poor people like me, it's not always as fast as we'd like. Now I'm waiting for an operation, but because my condition isn't yet life threatening, the waiting list where I live is two years. However move 100 miles away to Yorkshire, and it drops to three months - it's a no brainer really, I need to move now rather than wait until I get any worse.

     

     

    Here however comes a problem, and where I find myself in an extreme situation, having to ask what would normally be unaskable, such is my level of desperation. In order to move into a new area, you really need to have a flat, since employers don't have a habit of employing people "of no fixed abode" as the lawyers call it. Equally though, when applying to landlords they will want to contact your current or previous employer (within 6 months) employer to make sure you're not going to be a bad tenant. Since I've not officially been employed for the last 6 years now (have been a full time carer looking a sick relative), I'm stuck in the catch 22.

     

     

    There's only really one way out of it, I'll have to sell all my worldly goods and then use the proceeds to pay an entire 6 month tenancy upfront. Problem is my laptop and netbook will come to about £250 combined but my main computer is probably far too old. Who wants an Athlon 64 X2? How about 2GB of DDR2-800? Or some Creative speakers from about 1997? A keyboard with some of the letters rubbed away? I think the most valuable component I have is a GeForce 8800 GT, which you can buy for £50 brand new. so uh... Might get £500 for selling my computers. Anyone here know a landlord in Yorkshire who will accept that for a 6 month tenency? And that doesn't even consider the council tax.

     

     

    Of course I have two alternatives, but I really don't want to consider them. One of them I know is definitely illegal, and the other I'm not too sure on legality, but it's so degrading and dehumanising that I'm sure you've figured out what I'm getting at. This, is my level of absolute desperation.

     

     

    Despite what I've said above I wouldn't be happy accepting a donation if it was more than someone's disposable weekly income. Likewise I don't really want someone's savings either. Well obviously, that's not true, but I wouldn't be happy accepting them because as of right now, I have no idea when I'd be in a position to repay.

     

    Othwerwise, if anyone here could help contribute towards the costs, and/or knows of family/friends who could also help, I'd of course be most grateful.

     

    Also, whilst I will be selling my computers, I won't be deleting my account here. Internet cafés etc will at the very least, give me a fast way to see at a glance, who I owe.

     

     

    I'm a girl of pride - I don't normally like to ask for help, preferring instead to help others. I certainly wouldn't be asking for such a monumental favour if things weren't so desperate. But I guess what are the alternatives? Leave it two years, or until they decide my condition is life threatening? Or perhaps pay for private treatment, and start begging for something in the region of £20,000?

     

    So time for me to swallow my pride, and face the music: For those who can help, and are prepared to, here was the beggar's button...

  5. don't use Newton's own gravity at all, it just doesn't work (especially with airplanes and composed multi-part bodies you will see that it just goes nuts).

     

    There is no default gravity in Newton. Real Newton that is, Likewise, it's also possible to adjust the mass matrix, which I assume would make gravity work correctly for a plane.

    void ApplyGravity(const NewtonBody * body, const Entity * ent)
    {
       float * NewForce = (float*) malloc(3 * sizeof(float));
       NewForce[0] = 0.0f;
       NewForce[1] = GRAVITY_FORCE * ent->GetGravityMultiplier();
       NewForce[2] = 0.0f;
       NewtonBodyAddForce(body,NewForce);
       free(NewForce);
    }
    //callback signature provided by Newton. Most of this code is just copied straight from the tutorial... because it works.
    void ApplyForceOnlyCallback (const NewtonBody * body, dFloat timestep, int threadIndex)
    {
       Entity * ent = (Entity *) NewtonBodyGetUserData(body);
       dFloat Ixx, Iyy, Izz, mass;
       NewtonBodyGetMassMatrix (body, &mass, &Ixx, &Iyy, &Izz);
       TVec3 ForceToAdd = ent->GetForce();
       TVec3 InternalForce = ent->GetSelfForce();
       TVec3 CombinedForce = GetCombinedForce(ForceToAdd,InternalForce);
       ApplyForce(body,ent,CombinedForce);
       if(ent->GravityEnabled())
       {
           ApplyGravity(body,ent);
       }
       ent->ClearForces();
    }
    

     

    Of course, I never touch the mass matrix because it works fine for me, and messing about with things I don't know could, well, cause planes to fall out of the sky... But really, it should just be a case of modifying Ixx, Iyy and Izz. Don't ask what to though, because I don't know...

  6. Well, since that's not the way I handle it, I don't know what the second problem would be caused by, but at least the first one was found.

     

    Delete an actor and null it in the main code by all means (whether it'd good practice or not is purely personal opinion), but make sure any other class using that specific actor has it's pointer nulled too. Since for Projectile, the Actor pointer is private access, it just needs a member function to null it (which for what its worth, is what I'd call a stray pointer. Not exactly hidden, but one that should have been updated but wasn't)

     

    Beyond that, I've no idea if I've been helpful earlier, but I don't think I'm particularly helpful now at this stage, sorry.

  7. Maybe it's just my way of thinking. But I know in my project I have a base "GameEntity" class (which I think translates to your Actor class), that has a protected constructor. The way I'm set up, there is no reason for me to be creating these entities. A light, a door, a character, a weapon etc - they're all types of entities, and they inherit from it, so they can call the constructor themselves when they need it.

     

     

    If it were my project, it's likely that the Actor would not have a public constructor, and any type of Actor would either be a derived class, or a friend class. That doesn't mean there can't be a list of Actors available to read in the main gameplay class (or namespace as I have it), it's just that if I want to add an object to it, I have to create one of these special types instead.

     

     

     

    If I delete the Projectiles pointer of the actor it'll work for the Projectile class but the Gameplay classes list of these will then have the same issue.

     

    I can't see why you would want to delete a projectile's associated actor but not delete the rest of the projectile. Now obviously I'm sure you don't want to reveal too much about your game, because surprises are nice - but personally, I would just delete the entire projectile, which would delete its actor as part of its clean up.

     

     

    Now please don't take this as a lecture, because I'm sure of the two of us, you'd normally be the one teaching me...

  8. Note my proposed change to your Actor Projectile (whoops) class, and where it is deleted in main...

     

    Yes, we deleted a in _tmain before. but as far as p was concerned, it was still there...

     

     

    class Actor
    {
    private:
       int i;
    public:
       Actor() { i = 50; }
       void Increase() { i++; }
    };
    
    class Projectile
    {
    private:
    Actor* _actor;
    public:
       Projectile(Actor* actor) { _actor = actor; }
       void Update()
       {
           if(_actor)
               _actor->Increase();
       }
    
       void DeleteActor(void)
       {
       delete _actor;
       _actor = 0;//This is what we weren't doing before, hence why the if would still run
       }
    };
    
    int main(int argc, char * argv[])
    {
       Actor* a = new Actor();
       Projectile p(a);
       //delete a;
       p.DeleteActor(); //Presumably, your projectile class could be in charge of allocating its own Actors in the same way, but would obviously need a rewritten constructor
       a = 0; //Ideally, your projectile class does do it's own allocation and destruction. If it "new"s its Actor, then this isn't necessary
       p.Update(); 
    
       return 0;
    }

  9. Yes I must have been sniffing permanent markers earlier because I was sure that p(a) was valid, but sure enough the compiler didn't like it.

     

    There may not be a difference but the way I look it, the cast means I'm still pointing to a pointer, rather than pointing to a pointer's address, which perhaps it's just me, but that sounds wrong.

  10. OK yep, not quite what I was thinking, but does this work?

     

     

    class Actor
    {
    private:
       int i;
    public:
       Actor() { i = 50; }
       void Increase() { i++; }
    };
    
    class Projectile
    {
    private:
       Actor** _actor;
    public:
       Projectile(Actor** actor) { _actor = actor; }
       void Update()
       {
       if(_actor[0])
           _actor[0]->Increase();
       }
    
    };
    
    int main(int argc, char * argv[])
    {
       Actor * a = new Actor();
       Projectile p((Actor**)a);
       delete a;
       a = 0;
       p.Update();
       return 0;
    }
    

  11. OK, let's start at _tmain...

     

     

    I'm going to show where I've allocated memory but with low numbers just for example. Remember, we can't normally choose where our variables are allocated. Addresses in red, their values in blue.

     

     

     

    New variable a located at memory position 100 (for example). It is a pointer, so we create an Actor object at 150 for example. value of _tmain::a is therefore 150

     

     

     

    New variable p located at memory position 200. It is not a pointer or a primitive, so it has no value of it's own.

    p has a pointer member _actor, it is stored at 210, it has no value at this time

     

     

    _tmain::P._actor is located at 210, the constructor for _tmain::P has assigned it a value of 100, this would probably be better as 150, by leaving off the & sign

     

    a has been deleted. Value at 100 is now 0

     

    p.update has been called.

     

    Value of p::_actor checked. It is 100, so it is valid. We attempt to call a function - but this object instance is not there. Runtime error

     

     

    Now, if Projectile::_actor was assigned 150 by the constructor rather than 100 by simply passed a, rather than address of a. Then when a is deleted in _tmain, Update's if check would return a value of 0, not 100 and thus refuse to run the block.

     

    edit: emoticons disabled

  12. But you can't delete where _tmain::a's pointer is located in memory because you didn't allocate it. That was allocated implicitly when it was created. You can delete the object it points to but not the pointer itself. That will be lost when it falls out of scope same as any other variable, although what it points to stays valid until explicitly deleted - hence what memory leaks are.

  13. Would you not write p.a = a? since Projectile::a is a pointer to a pointer, and _tmain::a is already a pointer... That would allow a "straight passthrough"

     

    I could be wrong, but it looks like p.a isn't actually pointing to _tmain::a's object instance - it's pointing to where _tmain::a's pointer is located...

     

     

    p.a = &a would be correct if your actor object instance wasn't created by pointer... as in:

     

    Actor a();

     

    rather than

     

    Actor* a = new Actor();

  14. Sounds like a stray pointer issue to me... Are you using any pointers to your Actor class?

     

    Actor * Blah = new Actor(BlahBlah);
    Actor * ActorPtr = &Blah; //ActorPtr might be a void pointer in another class (like "UserData") but you get the idea
    ...
    delete Blah;
    Blah = 0;
    
    //ActorPtr still thinks the actor is valid - attempting to use it will crash
    

×
×
  • Create New...