Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ok-landscape
GitHub Repository: Ok-landscape/computational-pipeline
Path: blob/main/latex-templates/templates/game-development/pathfinding.tex
51 views
unlisted
1
\documentclass[11pt,a4paper]{article}
2
\usepackage[utf8]{inputenc}
3
\usepackage[T1]{fontenc}
4
\usepackage{amsmath,amssymb}
5
\usepackage{graphicx}
6
\usepackage{booktabs}
7
\usepackage{siunitx}
8
\usepackage{geometry}
9
\geometry{margin=1in}
10
\usepackage{pythontex}
11
\usepackage{hyperref}
12
\usepackage{float}
13
14
\title{Pathfinding\\Navigation Meshes}
15
\author{Game Development Research Group}
16
\date{\today}
17
18
\begin{document}
19
\maketitle
20
21
\begin{abstract}
22
AI navigation and movement algorithms.
23
\end{abstract}
24
25
\section{Introduction}
26
27
This report presents computational analysis of pathfinding.
28
29
\begin{pycode}
30
31
import numpy as np
32
import matplotlib.pyplot as plt
33
from scipy import stats, optimize, integrate
34
plt.rcParams['text.usetex'] = True
35
plt.rcParams['font.family'] = 'serif'
36
37
\end{pycode}
38
39
\section{Mathematical Framework}
40
41
\begin{pycode}
42
# Generate sample data
43
x = np.linspace(0, 10, 100)
44
y = np.sin(x) * np.exp(-0.1*x)
45
46
fig, ax = plt.subplots(figsize=(10, 6))
47
ax.plot(x, y, 'b-', linewidth=2)
48
ax.set_xlabel('x')
49
ax.set_ylabel('y')
50
ax.set_title('Primary Analysis')
51
ax.grid(True, alpha=0.3)
52
plt.tight_layout()
53
plt.savefig('pathfinding_plot1.pdf', dpi=150, bbox_inches='tight')
54
plt.close()
55
\end{pycode}
56
57
\begin{figure}[H]
58
\centering
59
\includegraphics[width=0.85\textwidth]{pathfinding_plot1.pdf}
60
\caption{Primary analysis results.}
61
\end{figure}
62
63
\section{Secondary Analysis}
64
65
\begin{pycode}
66
# Secondary visualization
67
y2 = np.cos(x) * np.exp(-0.2*x)
68
y3 = x * np.exp(-0.3*x)
69
70
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
71
ax1.plot(x, y2, 'r-', linewidth=2)
72
ax1.set_xlabel('x')
73
ax1.set_ylabel('y')
74
ax1.set_title('Analysis A')
75
ax1.grid(True, alpha=0.3)
76
77
ax2.plot(x, y3, 'g-', linewidth=2)
78
ax2.set_xlabel('x')
79
ax2.set_ylabel('y')
80
ax2.set_title('Analysis B')
81
ax2.grid(True, alpha=0.3)
82
plt.tight_layout()
83
plt.savefig('pathfinding_plot2.pdf', dpi=150, bbox_inches='tight')
84
plt.close()
85
\end{pycode}
86
87
\begin{figure}[H]
88
\centering
89
\includegraphics[width=0.95\textwidth]{pathfinding_plot2.pdf}
90
\caption{Secondary analysis comparison.}
91
\end{figure}
92
93
\section{Parameter Study}
94
95
\begin{pycode}
96
# Parameter variation
97
params = [0.1, 0.3, 0.5, 0.7]
98
99
fig, ax = plt.subplots(figsize=(10, 6))
100
for p in params:
101
y_p = np.exp(-p * x) * np.sin(x)
102
ax.plot(x, y_p, linewidth=1.5, label=f'$\\alpha$ = {p}')
103
ax.set_xlabel('x')
104
ax.set_ylabel('y')
105
ax.set_title('Parameter Sensitivity')
106
ax.legend()
107
ax.grid(True, alpha=0.3)
108
plt.tight_layout()
109
plt.savefig('pathfinding_plot3.pdf', dpi=150, bbox_inches='tight')
110
plt.close()
111
\end{pycode}
112
113
\begin{figure}[H]
114
\centering
115
\includegraphics[width=0.85\textwidth]{pathfinding_plot3.pdf}
116
\caption{Parameter sensitivity analysis.}
117
\end{figure}
118
119
\section{2D Visualization}
120
121
\begin{pycode}
122
# 2D contour plot
123
X, Y = np.meshgrid(np.linspace(-5, 5, 100), np.linspace(-5, 5, 100))
124
Z = np.sin(np.sqrt(X**2 + Y**2))
125
126
fig, ax = plt.subplots(figsize=(10, 8))
127
cs = ax.contourf(X, Y, Z, levels=20, cmap='viridis')
128
plt.colorbar(cs)
129
ax.set_xlabel('x')
130
ax.set_ylabel('y')
131
ax.set_title('2D Field')
132
plt.tight_layout()
133
plt.savefig('pathfinding_plot4.pdf', dpi=150, bbox_inches='tight')
134
plt.close()
135
\end{pycode}
136
137
\begin{figure}[H]
138
\centering
139
\includegraphics[width=0.85\textwidth]{pathfinding_plot4.pdf}
140
\caption{Two-dimensional field visualization.}
141
\end{figure}
142
143
\section{Distribution Analysis}
144
145
\begin{pycode}
146
# Statistical distribution
147
np.random.seed(42)
148
data = np.random.normal(5, 1.5, 1000)
149
150
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
151
ax1.hist(data, bins=30, density=True, alpha=0.7, color='steelblue')
152
x_dist = np.linspace(0, 10, 100)
153
ax1.plot(x_dist, stats.norm.pdf(x_dist, 5, 1.5), 'r-', linewidth=2)
154
ax1.set_xlabel('Value')
155
ax1.set_ylabel('Density')
156
ax1.set_title('Distribution')
157
158
ax2.boxplot([data, np.random.normal(4, 2, 1000)])
159
ax2.set_xticklabels(['Dataset 1', 'Dataset 2'])
160
ax2.set_ylabel('Value')
161
ax2.set_title('Box Plot')
162
plt.tight_layout()
163
plt.savefig('pathfinding_plot5.pdf', dpi=150, bbox_inches='tight')
164
plt.close()
165
\end{pycode}
166
167
\begin{figure}[H]
168
\centering
169
\includegraphics[width=0.95\textwidth]{pathfinding_plot5.pdf}
170
\caption{Statistical distribution analysis.}
171
\end{figure}
172
173
\section{Time Series}
174
175
\begin{pycode}
176
t = np.linspace(0, 100, 1000)
177
signal = np.sin(0.5*t) + 0.5*np.sin(2*t) + 0.3*np.random.randn(len(t))
178
179
fig, ax = plt.subplots(figsize=(12, 5))
180
ax.plot(t, signal, 'b-', linewidth=0.5, alpha=0.7)
181
ax.set_xlabel('Time')
182
ax.set_ylabel('Signal')
183
ax.set_title('Time Series Data')
184
ax.grid(True, alpha=0.3)
185
plt.tight_layout()
186
plt.savefig('pathfinding_plot6.pdf', dpi=150, bbox_inches='tight')
187
plt.close()
188
\end{pycode}
189
190
\begin{figure}[H]
191
\centering
192
\includegraphics[width=0.95\textwidth]{pathfinding_plot6.pdf}
193
\caption{Time series visualization.}
194
\end{figure}
195
196
\section{Results Summary}
197
198
\begin{pycode}
199
results = [
200
['Parameter A', '3.14'],
201
['Parameter B', '2.71'],
202
['Parameter C', '1.41'],
203
]
204
205
print(r'\\begin{table}[H]')
206
print(r'\\centering')
207
print(r'\\caption{Computed Results}')
208
print(r'\\begin{tabular}{@{}lc@{}}')
209
print(r'\\toprule')
210
print(r'Parameter & Value \\\\')
211
print(r'\\midrule')
212
for row in results:
213
print(f"{row[0]} & {row[1]} \\\\\\\\")
214
print(r'\\bottomrule')
215
print(r'\\end{tabular}')
216
print(r'\\end{table}')
217
\end{pycode}
218
219
\section{Conclusions}
220
221
This analysis demonstrates the computational approach to pathfinding.
222
223
\end{document}
224
225