Menu

#4 add support for volumes and weights Create issue

1.0
open
nobody
None
2020-07-15
2020-07-15
Lee Harr
No

Originally reported on Google Code with ID 8 ```

put apple in bag

You put the apple in the bag.

put orange in bag

You put the orange in the bag.

put banana in bag

The bag is full. You need a bigger bag.

get rose

You get the rose

get piano

The piano is too heavy.

Please notice that weights of objects that I am wearing and holding/carrying always add up, so even if an object that the player try to 'get' is light weight, the player might not be able to carry it due to excess weight.

```

Reported by hello.jay.araujo on 2009-01-08 06:34:11
Comments (5)

Former user Account Deleted

``` There is already some support for this. Doors can have a weight which requires an equal amount of strength to push through.

Containers and characters can be modified in the same way for more realistic uses.

```

Reported by `missive@hotmail.com` on 2009-01-11 15:43:07 - Status changed: `Accepted`
    2009-01-11
Former user Account Deleted

```

That would be awesome. I also suggest special care with how other players perceive what is happening.

In Alice's screen she'd read:

Jay tries to lift the piano but it's too heavy.

In reality, simulating get is a bit more complex than simple weights in the sense that

some things cannot be get not because they are too heavy, but because:

1) They are fixed or bolted to something: For instance, a small plant is fixed in the

ground. Or a sign can be bolted to a wall, etc

This could have a use in game. suppose you want to add support for illumination and

you want a room to have a light source ( a torch ) but you don't want any random player to be able to 'get' the torch (well you could always spawn new torches but you get the idea )

I suppose you already have a way in the engine to define something as 'ungetabble'.

But 2 possible enhancements would be:

1) Add support for reasons why it's not gettable:

get sign

Alice tries to pick up the sign but it's bolted to the wall.

2) Add support for 'get' requirements.

get plant

You need an axe to get this. ( Alice tries to get a plant but fails because the did not use an axe )

```

Reported by `hello.jay.araujo` on 2009-01-11 18:16:38
    2009-01-11
Former user Account Deleted

```

Hm... actually #1 in theory should be already possible using subclasses and the plugin system:

I tried it this way:

class BoltedSign(items.Item): 'A sign that is bolted to a wall'

name = 'sign' short = 'A sign on the wall with some letters written on it.'

def get(self, actor): return ( False, 'The sign is bolted to the wall' )

... but still can get the sign. What am I doing wrong?

```

Reported by `hello.jay.araujo` on 2009-01-11 18:43:39
    2009-01-11
Former user Account Deleted

```

Another example of why we need to solve is that currently I can put a tree in a cup,

which is not very nice. ;-) ```

Reported by `hello.jay.araujo` on 2009-01-11 20:52:24
    2009-01-11
Former user Account Deleted

``` I'm not sure what your ideas are to solve this issue but I can only think of 3 alternative

approaches.

1) Have some default weights and volumes and capacities in the base classes in case the sub classes don't provide one.

This is not good because there's no such thing in the real world as an average weight or size for such diverse things.

2) Make weight volumes and capacities specifications mandatory in subclasses

This would be the best solution for realism in the game but has the inconvenient that I cannot create an entity without spending some effort in determining it's expect weight volume or capacity.

3) Having the all base classes being weight-aware, volume-aware, etc and enforcing the use of those.

This one works one works like this:

Authors are not allowed to subclass Item directly. Instead the engine enforces the use of such base classes as TinyItem, SmallItem, HeavyItem etc...

The same way, ContainerItem is also not available for subclassing. Instead, container implementations should subclass SmallContainer, MediumContainer, LargeContainer etc.

This frees authors from having to specify weights and capacities, as it's already roughly specified in base class.

More advanced solutions may be possible but that's as far as I went. You might want to take a look on how Imaginary did it: http://divmod.org/trac/wiki/DivmodImaginary

... although they're leaning more towards realistic simulation.

```

Reported by `hello.jay.araujo` on 2009-01-11 21:29:07
    2009-01-11

Discussion


Log in to post a comment.