{"id":15671726,"url":"https://github.com/defgsus/lovebot","last_synced_at":"2025-03-30T05:24:30.389Z","repository":{"id":76002231,"uuid":"140308607","full_name":"defgsus/lovebot","owner":"defgsus","description":"Botlove python server and client + webclient","archived":false,"fork":false,"pushed_at":"2018-07-18T03:20:48.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T07:31:50.653Z","etag":null,"topics":["bot","botwars","client","love","server","simulation","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defgsus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-09T15:54:42.000Z","updated_at":"2018-07-18T03:20:49.000Z","dependencies_parsed_at":"2023-07-03T21:26:36.696Z","dependency_job_id":null,"html_url":"https://github.com/defgsus/lovebot","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"b88fae581b1ea0b2234368360ce71b160217e2e4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defgsus%2Flovebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defgsus%2Flovebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defgsus%2Flovebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defgsus%2Flovebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defgsus","download_url":"https://codeload.github.com/defgsus/lovebot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246280064,"owners_count":20752062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","botwars","client","love","server","simulation","websocket"],"created_at":"2024-10-03T15:04:47.234Z","updated_at":"2025-03-30T05:24:30.370Z","avatar_url":"https://github.com/defgsus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Lovebot\n\nThis is a lovely robot simulation running on a webserver.\n\n`loveserver.py` starts an http server that delivers a website to view the arena \nand a websocket server for observers and robot lovers.\n\nA simple client controlling a few bots is in the `examples` folder.\n\nBots live in a 2D world, constrained by solid objects and are themselves just circles \nwith [Braitenberg vehicle](https://en.wikipedia.org/wiki/Braitenberg_vehicle)-style\nwheels. The wheel-speed can be set individually for both wheels.\n\nThe world can be [ray traced](https://en.wikipedia.org/wiki/Ray_tracing_(graphics)) to\nfind intersections with objects or bots. More precisely, the world is described by\nsimple geometric objects that allow the efficient calculation of the distance \nto the next object's surface at any given point, \na technique called [sphere tracing](https://duckduckgo.com/?q=sphere+tracing).\n\nBasically, a client looks like this:\n\n```python\nfrom lovelib.client import LoveClient\n\nclass MyLoveClient(LoveClient):\n\n    def on_connect(self):\n        self.bot = self.create_bot(name=\"Dieter\") \n\n    def on_event(self, name, data):\n        pass\n\n    # called regularily\n    def on_update(self, delta_time):\n        # test distance to object at fixed location\n        d = self.world.distance_to(1, 2) \n        # find surface closest to bot in a certain direction\n        t = self.bot.trace_front()\n        t = self.bot.trace_degree(45)\n        # control movement\n        self.bot.set_wheel_speed(3, 4)\n        \nMyLoveClient(\"host\", \"user\", \"password\").mainloop()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefgsus%2Flovebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefgsus%2Flovebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefgsus%2Flovebot/lists"}