Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Shared sensors among allies #636

Closed
Closed

Description

@wzdev-ci

keyword_sensors_teams resolution_fixed type_bug | by Per


This patch adds the ability of allied players to share each others' sensors. For the moment, it only works for structures by structures, but that's just how the sensor code works at the moment and I will try to fix that in a separate patch.

Since iterating over all structures by all players to see if we could use each as a sensor would be rather time consuming, I created a new set of lists (currently with only one member) that sorts objects by function. This way we can very quickly iterate over all sensors, even when there are several hundred buildings on the map. The implementation of this is rather bug prone, since it is not type safe, but it is as good as it gets without a major rewrite or porting to C++, I think.

TODO: New list code needs testing to see if it crashes somewhere in campaign, since that does a lot of funky things to the lists code.


Issue migrated from trac:636 at 2022-04-15 18:54:18 -0700

Activity

  1. wzdev-ci commented on Jun 15, 2009

    @wzdev-ci
    ContributorAuthor

    Per uploaded file sharedsensor.diff (11.9 KiB)

  2. wzdev-ci commented on Jun 15, 2009

    @wzdev-ci
    ContributorAuthor

    Buginator commented


    Will this only be used for locked teams?

    Also, if this fails: ASSERT(object != NULL, "Invalid pointer");
    We will crash in a release build. Perhaps change that to ASSERT_OR_RETURN?

    Oh, and you might want to add a assert check to make sure player is in range?

  3. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per changed status from new to accepted

  4. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per changed owner from `` to Per

  5. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per commented


    Why only for locked teams? I'm not sure about changing all asserts to assert_or_return - sometimes the extra conditional is not really worth it, but I'll look into this one.

  6. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per commented


    New version of the patch. It fixes a few bugs, and generalizes the code to be utilized also for droids. Currently this support for droids has little effect, however, due to a number of bugs in the action code that I do not want to fix in this patch.

    It works the other way, though. You can take a sensor droid for a walk, point at interesting enemy structures, and sit back to watch the archangel missile battery fireworks.

  7. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per uploaded file sharedsensor2b.diff (19.1 KiB)

  8. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per uploaded file sharedsensor2c.diff (19.1 KiB)

    Fixed a bug that showed up during mission testing.

  9. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per set resolution to fixed

  10. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per changed status from accepted to closed

  11. wzdev-ci commented on Jun 17, 2009

    @wzdev-ci
    ContributorAuthor

    Per commented


    (In [7765]) Add the ability of allied players to share each others' sensors. Since iterating over all structures
    by all players to see if we could use each as a sensor would be rather time consuming, I created a
    new set of lists (currently with only one member) that sorts objects by function. This way we can
    very quickly iterate over all sensors, even when there are several hundred buildings on the map.
    Closes #636.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions