Totalmente esperado - Fishing World - Devlog #2

Descubre el devlog 2 de Fishing World: solución de renderizado con área visible calculada, manejo de bordes y fragmentos del mapa; prototipo de movimiento por clic y planes de optimización.

7 sept 2025 • 3 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Totalmente esperado - Fishing World - Devlog 2

Problemas de renderizado

La primera prueba de la función de renderizado que mostré en el devlog anterior funcionó bien porque la lista era de 2x2, justo el número de tiles para llenar la pantalla. Cuando intenté usar la misma función con un mapa más grande, terminó renderizando prácticamente todo.

Mientras escribía aquel post vi algunos errores, así que reescribí la función. Puede que ahora esté un poco menos ordenada, pero es la más sólida que he hecho hasta la fecha. La idea es simple y efectiva: a partir de la posición del jugador calculo un rectángulo visible con el número máximo de tiles por eje, corrijo los límites si se salen del mapa, aplico un desplazamiento para que la rejilla no se corte en pantalla y extraigo un fragmento del mapa que sí se va a dibujar. Luego recorro ese fragmento y bliteo cada tile usando el tamaño de tile y los márgenes configurados. Este enfoque evita dibujar tiles que no están a la vista y deja la puerta abierta a futuras optimizaciones de rendimiento.

Un detalle importante fue gestionar correctamente los bordes. Si el jugador está tan a la izquierda o arriba que la rejilla visible se saldría, ajusto left y top a cero y compenso con un offset para que todo encaje. Igual con right y bottom si exceden los límites del mapa. Con eso, solo corto el array de tiles a la ventana visible y lo dibujo. Pendiente queda optimizar el bucle de dibujado para reducir llamadas a blit cuando sea posible.

Por fin algo de diversión

Con el render estable por ahora, me di el gusto de crear unos tiles básicos para pruebas. Y con todo ese tiempo invertido, solo salió un humilde tile de pasto 32x32 que no ganará premios, pero cumple y me permite validar tamaños, proporciones y contraste.

Movimiento

A partir de ahí planifiqué cómo quería que funcionara la interacción de movimiento. La UI en pygame no es precisamente amigable, así que prototipé un toque para mover. Convierto la posición del clic a la celda de la rejilla impactada y muevo el jugador hacia esa celda. El flujo quedó muy limpio y el resultado es inmediato y satisfactorio.

Palabras finales

Retrasé un poco este devlog porque no tuve mucho tiempo para avanzar, pero confío en que estos pasos pequeños me lleven a construir uno de mis mejores juegos.

Gracias por leer. Nos vemos en el siguiente.

Sobre Q2BSTUDIO

En Q2BSTUDIO impulsamos proyectos como este con software a medida y aplicaciones a medida pensadas para crecer sin fricciones. Si buscas un equipo que diseñe y construya productos robustos, escalables y con foco en la experiencia de usuario, descubre cómo abordamos el ciclo completo de desarrollo en nuestra página de aplicaciones a medida y software a medida. También integramos inteligencia artificial de forma práctica para casos como pathfinding, optimización de renderizado o agentes que automaticen pruebas y balanceo de dificultad. Si te interesa llevar IA para empresas a tu producto, explora nuestros servicios de inteligencia artificial.

Además, ofrecemos ciberseguridad con enfoque preventivo, servicios cloud aws y azure para despliegues elásticos, servicios inteligencia de negocio con power bi, automatización de procesos y agentes IA para acelerar la toma de decisiones. Si estás pensando en llevar tu juego, app o plataforma al siguiente nivel, hablemos.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat