Comments (11)
The Unit Tests seem to be mostly working, they seem to have trouble running all together, but run fine individually. Timing can still be an issue... that's a whole other problem. They've at least helped identify some issues with Py3 and PyMunk5, so it's been helpful.
from spacebattlearena.
I see the problem. In PhysicalEllipse.__init__, the following division should have been left as a float division (in the py3 branch, it truncates to zero so all the points in the polygon end up being the same):
def __init__(self, size, mass, pos, segments=16):
...
ang = math.pi * 2 // segments
from spacebattlearena.
Did quick patch on the boundaries of the network lib for compatibility with client, gets us forward for now. Network lib is oldest part, as it predates the project anyway.
Biggest known problem left is the world wrap-around, looking at that next. Otherwise, we're pretty good???
Will investigate if we can run the existing unit tests from VS Code or not.
from spacebattlearena.
Found the wrapping issue here in WorldMap: https://github.com/Mikeware/SpaceBattleArena/blob/py3/SBA_Serv/World/WorldMap.py#L222
The vector seems immutable now, but haven't found correct pattern yet.
This is also a problem in the Warp command here: https://github.com/Mikeware/SpaceBattleArena/blob/py3/SBA_Serv/World/WorldCommands.py#L317
from spacebattlearena.
Hitting this same issue with py2exe, they've changed something, so need to find new paradigm, but not sure what it is. All info around pygame and py2exe seems old.
from spacebattlearena.
Looks like py2exe is pretty old, seeing if cx_Freeze will work instead.
from spacebattlearena.
Wow, division changed between Python 2 and 3 🙄
http://python-future.org/compatible_idioms.html#division
I could only repro on the py3 branch (and not the master branch). I'm on Python 3.7.6 with dependencies from requirements.txt.
Repro:
Use mousewheel and click to spawn a wormhole
Hit "d" to turn on debug mode
Result: Crash
2020-02-13 15:16:50,335|5153|ERROR|MainThread|main|697|startGame|FATAL Error in GUI!!!
Traceback (most recent call last):
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\main.py", line 274, in startGame
obj.draw(worldsurface, flags)
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\ObjWrappers\WormHoleWrapper.py", line 43, in draw
wrapcircle(surface, c, intpos(self._worldobj.exit.body.position), self._worldobj.radius / 2, self._world.size, 2) # 'target'
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\Helpers.py", line 31, in wrapcircle
pygame.draw.circle(surface, color, pos, radius, thickness)
TypeError: integer argument expected, got float
2020-02-13 15:16:50,340|5158|ERROR|MainThread|main|698|startGame|Traceback (most recent call last):
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\main.py", line 274, in startGame
obj.draw(worldsurface, flags)
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\ObjWrappers\WormHoleWrapper.py", line 43, in draw
wrapcircle(surface, c, intpos(self._worldobj.exit.body.position), self._worldobj.radius / 2, self._world.size, 2) # 'target'
File "C:\Users\jared\Code\SpaceBattleArena\SBA_Serv\GUI\Helpers.py", line 31, in wrapcircle
pygame.draw.circle(surface, color, pos, radius, thickness)
TypeError: integer argument expected, got float
Log file: SBA_Serv2020-02-13_151646.log
from spacebattlearena.
@jaredkrinke started a py3-unittest
branch that runs in VS 2019. Started fixing a few unit tests like the failing PlayerStat ones. Haven't looked at the above WormHole one yet, but that should be an easy fix, probably easiest to switch to // floor division to make sure there's an int.
from spacebattlearena.
@jaredkrinke think I have a fix for the wormholewrapper I'm going to push in a minute.
Found another issue that I'm not sure about yet though:
Traceback (most recent call last):
File "C:\code\SpaceBattleArena\SBA_Serv\GUI\main.py", line 127, in addorremove
bgobjects[obj.id] = NebulaGUI(obj, world)
File "C:\code\SpaceBattleArena\SBA_Serv\GUI\ObjWrappers\NebulaWrapper.py", line 13, in __init__
super(NebulaGUI, self).__init__(nebula, world)
File "C:\code\SpaceBattleArena\SBA_Serv\GUI\ObjWrappers\GUIEntity.py", line 20, in __init__
self._points = self.get_world_points(self._worldobj)
File "C:\code\SpaceBattleArena\SBA_Serv\GUI\ObjWrappers\GUIEntity.py", line 85, in get_world_points
points += [(vertex.rotated(worldobj.body.angle) + worldobj.body.position).int_tuple]
File "C:\code\SpaceBattleArena\SBA_Serv\env\lib\site-packages\pymunk\vec2d.py", line 481, in __get_int_xy
return int(self.x), int(self.y)
ValueError: cannot convert float NaN to integer
Happened when deleting stuff from the world in the Server GUI.
from spacebattlearena.
FYI: I see that error every time I run the server (with no arguments).
from spacebattlearena.
Ah, thanks @jaredkrinke! That's a recent change I did, I was over-aggressive on my changes back to int division.
from spacebattlearena.
Related Issues (20)
- Update unit tests for new blocking default for Thrust
- Server crashes running Bauble Hunt with a Basic ship HOT 1
- Add no_gravity_drag.cfg to Find The Middle Lesson Plan
- Add link to CSTA talk on main page
- Spam Stacktrace of existing connection was forcibly closed
- Very high CPU usage HOT 7
- Cannot get information of other ships? HOT 2
- Windows DPI Settings effect Window's Size
- Support for Borderless Fullscreen Window Mode
- BaubleHunt Stats Should Show Weight Not Number Carried
- [CLOSED] Setting ship's name as "\0\0\0" causes server to freeze HOT 1
- [BaubleHunt] Baubles can be deposited in any base not just the players
- More Instructions on release notes please HOT 1
- Concurrent Issues with GraphicsCache Sometimes
- Issue with World Clean-up in BaubleHunt
- Zombie Ship
- Make the font of the server configurable...
- Add .NET Client HOT 1
- GraphicalClient uses uninitialized field.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spacebattlearena.