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

[VERY WIP] Portals #6951

Conversation

Projects
None yet
6 participants
@kevingranade
Copy link
Member

commented Mar 27, 2014

Has a lot of rough edges, unimplemented bits, bugs, and a memory leak you could drive a killdozer through.
I thought people might want to play with it though. Once I sort out what I need to do, I'm probably completely obliterating those last two commits.
That aside, what's it do?
It hooks into the field of view calculation code, when it detects a portal in a scan, it casts a special "portal" type shadow instead of a normal shadow. A later hack into the map draw code checks for this special shadow and substitutes content from a special "foreign" map instead of from the regular map.
pic $= words * 1000
http://polehammer.com/azmodean/holy_crap_portals.png
As you can see, it renders a different map where you'd expect the shadow for the portal to be.
TODO:

  • Fix the shadowcasting bug that makes the shadow too wide.
  • Close the gigantic memory leak, we leak a map every tick that a portal is visible.
  • Generate and substitute in the lightmap from the foreign map where appropriate.
  • Maybe cast light through the portals.
  • Render monsters, npcs from foreign map.
  • Maybe allow firing through portals.
  • Maybe implement monster vision/hearing (definitely NOT scent) through portals.
  • Implement teleporting to the destination of the portal.
  • Place portals somewhere in the world.
  • Maybe hook it up to the portal generator item.
  • Make baddies pop out of portals?
  • Fix bug where portal destination is always drawn from the current overmap layer.
  • Make the portal appear at a random offset relative to the current location rather than a random position on the current overmap.
  • Fix the bug where rendering intermittently flashes on and off.
    More I've forgotten about, TODOs are sprinkled throughout the code.
@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2014

This is brilliant!

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Mar 27, 2014

Too cool!

@Lain-

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2014

Looking forward to this!

@ghost

This comment has been minimized.

Copy link

commented Jun 8, 2014

@kevingranade, any more updates on this? I was really looking forward to it.

@kevingranade

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2014

I'm keeping it updated, but I actually don't have a mechanism to work it into the game itself.
I'm adding little pieces of functionality every time I update it, so it'll get there eventually.
Right now I'm getting it to teleport the player.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Jun 10, 2014

I'm looking forward to this with great anticipation.

@kevingranade

This comment has been minimized.

Copy link
Member Author

commented Jun 11, 2014

Now stepping into a portal teleports you to the other side. I was planning on setting the other side of the portal to return to your previous location, but I wasn't able to get it working.

@KA101 KA101 force-pushed the CleverRaven:master branch from a342a64 to 0da0595 Oct 30, 2014

@DavidKeaton

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2015

Link the portals up with an id, and have the portals share an id. So portal id 1 teleports to the other portal with id 1. One could use a vector (or map) to associate with a 2 sized array containing pointers to a portal info struct, and it could contain pointers to both portals, or something.

If you store the coords of the portal in the info struct, you could hop to that coord to continue shadowcasting, if you can see it.

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Dec 3, 2015

No progress for over a year, closing.

@OzoneH3 OzoneH3 closed this Dec 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.