Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The “enumeration of directed activities” model can’t describe complex movements with enough flexibility #64

Open
hendrikbez opened this issue Feb 19, 2024 · 8 comments

Comments

@hendrikbez
Copy link

Screenshot_2
When I am on the wall, and start moving the items, it goes down before it reach the conveyer belt

@dougmencken
Copy link
Owner

the room is blacktooth19.xml by the way

@dougmencken
Copy link
Owner

by the way, can you @hendrikbez pass blacktooth18.xml without cheats? it looks like the diver robot there doesn't carry the thing above it (which is roughly related to #66 )

blacktooth18

@dougmencken
Copy link
Owner

dougmencken commented Mar 1, 2024

the following patch fixes the diver robot
... and the game mechanics at all

--- a/source/activities/Moving.cpp
+++ b/source/activities/Moving.cpp
@@ -154,12 +154,17 @@ bool Moving::move( behaviors::Behavior* behavior, Activity* activity, bool itFal
         // if the item can move freely
         if ( item->whichItemClass() == "free item" || item->whichItemClass() == "avatar item" )
         {
-                if ( /* not moving up or down, to not change the activity of items on elevator */
-                        ( *activity != activities::Activity::GoingUp && *activity != activities::Activity::GoingDown )
-                                || /* there’s a collision */ ! moved )
+                bool onElevator = ( *activity == activities::Activity::GoingUp || *activity == activities::Activity::GoingDown );
+                if ( /* don’t affect activity of items on elevator */ ! onElevator )
                 {
-                        // move adjacent items
-                        PropagateActivity::toAdjacentItems( *item, toItemsNearby );
+                        if ( /* there’s a collision */ ! moved ) {
+                                // move adjacent items
+                                PropagateActivity::toAdjacentItems( *item, toItemsNearby );
+                        }
+                        else {
+                                // maybe there’s something above
+                                PropagateActivity::toItemsAbove( *item, toItemsNearby );
+                        }
                 }
         }

image

but... not including the problem mentioned in the original post 😥

@hendrikbez
Copy link
Author

Thank You

Hendrik

@dougmencken
Copy link
Owner

it really is quite unphysical, and I'm unsure how to solve it....

pushing an item onto a conveyor

maybe make a conveyor drag things only when it takes at least a quarter (a third??) of the conveyor's width?..

@dougmencken
Copy link
Owner

dougmencken commented May 11, 2024

... and if you wish to play within a room from the previous message, here's the patch

add-some-stuff-to-the-heels-initial-room.patch.zip

--- a/gamedata/map/blacktooth23heels.xml
+++ b/gamedata/map/blacktooth23heels.xml
@@ -62,6 +62,40 @@
         </wall>
     </walls>
     <items>
+        <item x="5" y="3" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="5" y="4" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="6" y="3" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="6" y="4" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="7" y="3" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="7" y="4" z="0">
+            <kind>brick1</kind>
+            <class>griditem</class>
+        </item>
+        <item x="7" y="3" z="1">
+            <kind>stool</kind>
+            <behavior>behavior of thing able to move by pushing</behavior>
+            <class>freeitem</class>
+        </item>
+        <item x="7" y="4" z="1">
+            <kind>stool</kind>
+            <behavior>behavior of thing able to move by pushing</behavior>
+            <class>freeitem</class>
+        </item>
         <item x="8" y="0" z="0">
             <kind>vulcano</kind>
             <orientation>none</orientation>

@dougmencken
Copy link
Owner

maybe make a conveyor drag things only when it takes at least a quarter (a third??) of the conveyor's width?..

I really thought about the complete redesign of all these activities and movements. So that it’s not “activity of moving southwest” but a velocity vector, which can be summed (or even premultiplied and summed) with another such vector, giving a complex motion.

@dougmencken dougmencken changed the title The moving item does not go on the conveyer belt, it fall just before it, it should go all the way on the conveyer belt The “enumeration of directed activities” model can’t describe complex movements with enough flexibility May 19, 2024
dougmencken added a commit that referenced this issue Oct 23, 2024
for more info
  the “enumeration of directed activities” model can’t describe complex movements
  with enough flexibility #64
@dougmencken
Copy link
Owner

Motion2D and Motion3D aren’t used yet in faaac40, but it looks like a nice go, isn’t it?

dougmencken added a commit that referenced this issue Oct 24, 2024
and it looks simpler than the previously used “enumeration of directed activities” model #64
dougmencken added a commit that referenced this issue Oct 28, 2024
now the #64 “enumeration of directed activities” model is almost* replaced

* “pushed up” is still there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants