mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-05 02:39:41 +01:00
No description
662a658cf6
I noticed that if I have a large amount of entities in the room, the game starts to freeze and one frame would take a very long time. I identified an obvious cause of this, which is that the entity collision checking in entityclass::entitycollisioncheck() is O(n²), n being the number of entities in the room. But it doesn't need to be O(n²). The only entities you need to check against all other entities are the player and the supercrewmate. You don't need to "test entity to entity" if 99% of the pairs of entities you're checking don't involve the player or supercrewmate. How do we make it O(n)? Well, just hoist the rule 0 and type 14 checks out of the inner for-loop. That way, the inner for-loop won't be unconditionally ran, meaning that in most cases it will always be O(n). However, if you start having large amounts of duplicate player or supercrewmate entities (I don't know why you would), it would start approaching O(n²), but I feel like that's fair in that case. But most of the time, it will be O(n). So that's how collision checking is now O(n) instead. |
||
---|---|---|
.github | ||
desktop_version | ||
mobile_version | ||
third_party | ||
tools | ||
.gitattributes | ||
License exceptions.md | ||
LICENSE.md | ||
README.md |
This is the source code to VVVVVV, version 2.0+. For more context about this release, see the announcement on Terry's blog!
License
VVVVVV's source code is made available under a custom license. See LICENSE.md for more details.
In general, if you're interested in creating something that falls outside the license terms, get in touch with Terry and we'll talk about it!
Authors
- Created by Terry Cavanagh
- Room Names by Bennett Foddy
- Music by Magnus Pålsson
- Metal Soundtrack by FamilyJules
- 2.0 Update (C++ Port) by Simon Roth
- 2.2 Update (SDL2/PhysicsFS/Steamworks port) by Ethan Lee
- Beta Testing by Sam Kaplan and Pauli Kohberger
- Ending Picture by Pauli Kohberger
Versions
There are two versions of the VVVVVV source code available - the desktop version (based on the C++ port, and currently live on Steam), and the mobile version (based on a fork of the original flash source code, and currently live on iOS and Android).